Method: Sequel::Dataset::PlaceholderLiteralizer#append_sql
- Defined in:
- lib/sequel/dataset/placeholder_literalizer.rb
#append_sql(sql, *args) ⇒ Object
Append the SQL query to use for the given arguments to the given SQL string.
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 |
# File 'lib/sequel/dataset/placeholder_literalizer.rb', line 207 def append_sql(sql, *args) ds = @dataset @fragments.each do |s, i, transformer| sql << s if i.is_a?(Integer) v = args.fetch(i) v = transformer.call(v) if transformer else v = i.call end ds.literal_append(sql, v) end sql << @final_sql sql end |