Method: Array#sql_string_join
- Defined in:
- lib/sequel/extensions/core_extensions.rb
#sql_string_join(joiner = nil) ⇒ Object
Return a Sequel::SQL::StringExpression
representing an SQL string made up of the concatenation of this array’s elements. If an argument is passed it is used in between each element of the array in the SQL concatenation.
[:a].sql_string_join # SQL: a
[:a, :b].sql_string_join # SQL: (a || b)
[:a, 'b'].sql_string_join # SQL: (a || 'b')
['a', :b].sql_string_join(' ') # SQL: ('a' || ' ' || b)
92 93 94 |
# File 'lib/sequel/extensions/core_extensions.rb', line 92 def sql_string_join(joiner=nil) Sequel.join(self, joiner) end |