Method: Sequel::Postgres::PGMultiRange#sql_literal_append
- Defined in:
- lib/sequel/extensions/pg_multirange.rb
#sql_literal_append(ds, sql) ⇒ Object
Append the multirange SQL to the given sql string.
272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 |
# File 'lib/sequel/extensions/pg_multirange.rb', line 272 def sql_literal_append(ds, sql) sql << db_type << '(' joiner = nil conversion_meth = nil each do |range| if joiner sql << joiner else joiner = ', ' end unless range.is_a?(PGRange) conversion_meth ||= :"typecast_value_#{db_type.sub('multi', '')}" range = ds.db.send(conversion_meth, range) end ds.literal_append(sql, range) end sql << ')' end |