Class Sequel::SQL::StringAgg
In: lib/sequel/extensions/string_agg.rb
Parent: GenericExpression

The StringAgg class represents an aggregate string concatentation.

Methods

distinct   is_distinct?   new   order  

Included Modules

StringMethods StringConcatenationMethods InequalityMethods AliasMethods CastMethods OrderMethods PatternMatchMethods SubscriptMethods

Classes and Modules

Module Sequel::SQL::StringAgg::DatasetMethods

Attributes

expr  [R]  The string expression for each row that will concatenated to the output.
order_expr  [R]  The expression that the aggregation is ordered by.
separator  [R]  The separator between each string expression.

Public Class methods

Set the expression and separator

[Source]

     # File lib/sequel/extensions/string_agg.rb, line 148
148:       def initialize(expr, separator=nil)
149:         @expr = expr
150:         @separator = separator
151:       end

Public Instance methods

Return a modified StringAgg that uses distinct expressions

[Source]

     # File lib/sequel/extensions/string_agg.rb, line 159
159:       def distinct
160:         sa = dup
161:         sa.instance_variable_set(:@distinct, true)
162:         sa
163:       end

Whether the current expression uses distinct expressions

[Source]

     # File lib/sequel/extensions/string_agg.rb, line 154
154:       def is_distinct?
155:         @distinct == true
156:       end

Return a modified StringAgg with the given order

[Source]

     # File lib/sequel/extensions/string_agg.rb, line 166
166:       def order(*o)
167:         sa = dup
168:         sa.instance_variable_set(:@order_expr, o.empty? ? nil : o)
169:         sa
170:       end

[Validate]