Module | Sequel::Dataset::ArgumentMapper |
In: |
lib/sequel/adapters/postgres.rb
lib/sequel/adapters/sqlite.rb lib/sequel/dataset/prepared_statements.rb |
Default implementation of the argument mapper to allow native database support for bind variables and prepared statements (as opposed to the emulated ones used by default).
SQL_QUERY_TYPE | = | Hash.new{|h,k| h[k] = k} |
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 34 34: def prepared_sql 35: return @prepared_sql if @prepared_sql 36: @prepared_args ||= [] 37: @prepared_sql = super 38: meta_def("#{sql_query_type}_sql"){|*args| prepared_sql} 39: @prepared_sql 40: end
An array of bound variable values for this query, in the correct order.
# File lib/sequel/adapters/postgres.rb, line 354 354: def map_to_prepared_args(hash) 355: prepared_args.map{|k| hash[k.to_sym]} 356: end