| Module | Sequel::Dataset::ArgumentMapper |
| In: |
lib/sequel/dataset/prepared_statements.rb
lib/sequel/adapters/sqlite.rb lib/sequel/adapters/postgres.rb |
PostgreSQL specific argument mapper used for mapping the named argument hash to a array with numbered arguments. Only used with the pg driver.
| bind_arguments | [RW] | The bind arguments to use for running this prepared statement |
| prepared_statement_name | [RW] | The name of the prepared statement, if any. |
Override the given *_sql method based on the type, and cache the result of the sql.
# File lib/sequel/dataset/prepared_statements.rb, line 31
31: def prepared_sql
32: return @prepared_sql if @prepared_sql
33: @prepared_args ||= []
34: @prepared_sql = super
35: @opts[:sql] = @prepared_sql
36: @prepared_sql
37: end
Return a hash with the same values as the given hash, but with the keys converted to strings.
# File lib/sequel/adapters/sqlite.rb, line 221
221: def map_to_prepared_args(hash)
222: args = {}
223: hash.each{|k,v| args[k.to_s.gsub('.', '__')] = v}
224: args
225: end