Class: Arel::Visitors::PostgreSQL
Do not use. This class is for internal use only.
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
|
|
Instance Chain:
|
|
Inherits: |
Arel::Visitors::ToSql
|
Defined in: | activerecord/lib/arel/visitors/postgresql.rb |
Constant Summary
-
BIND_BLOCK =
private
# File 'activerecord/lib/arel/visitors/postgresql.rb', line 81proc { |i| "$#{i}" }
ToSql
- Inherited
Class Method Summary
Instance Attribute Summary
Instance Method Summary
- #bind_block private
-
#grouping_array_or_grouping_element(o, collector)
private
Utilized by GroupingSet, Cube & RollUp visitors to handle grouping aggregation semantics.
- #visit_Arel_Nodes_Cube(o, collector) private
- #visit_Arel_Nodes_DistinctOn(o, collector) private
- #visit_Arel_Nodes_DoesNotMatch(o, collector) private
- #visit_Arel_Nodes_GroupingElement(o, collector) private
- #visit_Arel_Nodes_GroupingSet(o, collector) private
- #visit_Arel_Nodes_IsDistinctFrom(o, collector) private
- #visit_Arel_Nodes_IsNotDistinctFrom(o, collector) private
- #visit_Arel_Nodes_Lateral(o, collector) private
- #visit_Arel_Nodes_Matches(o, collector) private
- #visit_Arel_Nodes_NotRegexp(o, collector) private
- #visit_Arel_Nodes_Regexp(o, collector) private
- #visit_Arel_Nodes_RollUp(o, collector) private
ToSql
- Inherited
Visitor
- Inherited
Constructor Details
This class inherits a constructor from Arel::Visitors::ToSql
Instance Method Details
#bind_block (private)
[ GitHub ]# File 'activerecord/lib/arel/visitors/postgresql.rb', line 84
def bind_block; BIND_BLOCK; end
#grouping_array_or_grouping_element(o, collector) (private)
Utilized by GroupingSet, Cube & RollUp visitors to handle grouping aggregation semantics
# File 'activerecord/lib/arel/visitors/postgresql.rb', line 88
def grouping_array_or_grouping_element(o, collector) if o.expr.is_a? Array collector << "( " visit o.expr, collector collector << " )" else visit o.expr, collector end end
#visit_Arel_Nodes_Cube(o, collector) (private)
[ GitHub ]# File 'activerecord/lib/arel/visitors/postgresql.rb', line 49
def visit_Arel_Nodes_Cube(o, collector) collector << "CUBE" grouping_array_or_grouping_element o, collector end
#visit_Arel_Nodes_DistinctOn(o, collector) (private)
[ GitHub ]# File 'activerecord/lib/arel/visitors/postgresql.rb', line 39
def visit_Arel_Nodes_DistinctOn(o, collector) collector << "DISTINCT ON ( " visit(o.expr, collector) << " )" end
#visit_Arel_Nodes_DoesNotMatch(o, collector) (private)
[ GitHub ]# File 'activerecord/lib/arel/visitors/postgresql.rb', line 18
def visit_Arel_Nodes_DoesNotMatch(o, collector) op = o.case_sensitive ? " NOT LIKE " : " NOT ILIKE " collector = infix_value o, collector, op if o.escape collector << " ESCAPE " visit o.escape, collector else collector end end
#visit_Arel_Nodes_GroupingElement(o, collector) (private)
[ GitHub ]# File 'activerecord/lib/arel/visitors/postgresql.rb', line 44
def visit_Arel_Nodes_GroupingElement(o, collector) collector << "( " visit(o.expr, collector) << " )" end
#visit_Arel_Nodes_GroupingSet(o, collector) (private)
[ GitHub ]# File 'activerecord/lib/arel/visitors/postgresql.rb', line 59
def visit_Arel_Nodes_GroupingSet(o, collector) collector << "GROUPING SETS" grouping_array_or_grouping_element o, collector end
#visit_Arel_Nodes_IsDistinctFrom(o, collector) (private)
[ GitHub ]# File 'activerecord/lib/arel/visitors/postgresql.rb', line 75
def visit_Arel_Nodes_IsDistinctFrom(o, collector) collector = visit o.left, collector collector << " IS DISTINCT FROM " visit o.right, collector end
#visit_Arel_Nodes_IsNotDistinctFrom(o, collector) (private)
[ GitHub ]# File 'activerecord/lib/arel/visitors/postgresql.rb', line 69
def visit_Arel_Nodes_IsNotDistinctFrom(o, collector) collector = visit o.left, collector collector << " IS NOT DISTINCT FROM " visit o.right, collector end
#visit_Arel_Nodes_Lateral(o, collector) (private)
[ GitHub ]# File 'activerecord/lib/arel/visitors/postgresql.rb', line 64
def visit_Arel_Nodes_Lateral(o, collector) collector << "LATERAL " grouping_parentheses o.expr, collector end
#visit_Arel_Nodes_Matches(o, collector) (private)
[ GitHub ]# File 'activerecord/lib/arel/visitors/postgresql.rb', line 7
def visit_Arel_Nodes_Matches(o, collector) op = o.case_sensitive ? " LIKE " : " ILIKE " collector = infix_value o, collector, op if o.escape collector << " ESCAPE " visit o.escape, collector else collector end end
#visit_Arel_Nodes_NotRegexp(o, collector) (private)
[ GitHub ]# File 'activerecord/lib/arel/visitors/postgresql.rb', line 34
def visit_Arel_Nodes_NotRegexp(o, collector) op = o.case_sensitive ? " !~ " : " !~* " infix_value o, collector, op end
#visit_Arel_Nodes_Regexp(o, collector) (private)
[ GitHub ]# File 'activerecord/lib/arel/visitors/postgresql.rb', line 29
def visit_Arel_Nodes_Regexp(o, collector) op = o.case_sensitive ? " ~ " : " ~* " infix_value o, collector, op end
#visit_Arel_Nodes_RollUp(o, collector) (private)
[ GitHub ]# File 'activerecord/lib/arel/visitors/postgresql.rb', line 54
def visit_Arel_Nodes_RollUp(o, collector) collector << "ROLLUP" grouping_array_or_grouping_element o, collector end