Class: Select
- Inherits:
-
Expression
- Object
- Expression
- Select
- Defined in:
- lib/eno/expressions.rb
Constant Summary collapse
- S_SELECT =
'select %s%s'
- S_DISTINCT =
'distinct '
- S_DISTINCT_ON =
'distinct on (%s) '
- S_DISTINCT_ON_SINGLE =
'distinct on %s '
Constants inherited from Expression
Expression::S_AND, Expression::S_DIV, Expression::S_EQ, Expression::S_GT, Expression::S_GTE, Expression::S_LT, Expression::S_LTE, Expression::S_MINUS, Expression::S_MOD, Expression::S_MUL, Expression::S_NEQ, Expression::S_OR, Expression::S_PLUS, Expression::S_TILDE
Instance Attribute Summary
Attributes inherited from Expression
Instance Method Summary collapse
Methods inherited from Expression
#!=, #!@, #%, #&, #*, #+, #-, #/, #<, #<=, #==, #=~, #>, #>=, #^, #as, #cast, #desc, #in, #initialize, #inner_join, #join, #not_in, #not_null?, #null?, #over, #|
Constructor Details
This class inherits a constructor from Expression
Instance Method Details
#distinct_clause(sql) ⇒ Object
510 511 512 513 514 515 516 517 518 519 520 521 |
# File 'lib/eno/expressions.rb', line 510 def distinct_clause(sql) case (on = @props[:distinct]) when nil nil when true S_DISTINCT when Array S_DISTINCT_ON % on.map { |e| sql.quote(e) }.join(S_COMMA) else S_DISTINCT_ON_SINGLE % sql.quote(on) end end |