Module Sequel::Dataset::ArgumentMapper
In: lib/sequel/dataset/prepared_statements.rb
lib/sequel/adapters/sqlite.rb

SQLite already supports named bind arguments, so use directly.

Methods

Included Modules

Sequel::Dataset::ArgumentMapper

Attributes

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.

Public Instance methods

Set the bind arguments based on the hash and call super.

[Source]

    # File lib/sequel/dataset/prepared_statements.rb, line 51
51:       def call(bind_vars={}, &block)
52:         ds = bind(bind_vars)
53:         ds.prepared_sql
54:         ds.bind_arguments = ds.map_to_prepared_args(ds.opts[:bind_vars])
55:         ds.run(&block)
56:       end

Override the given *_sql method based on the type, and cache the result of the sql.

[Source]

    # File lib/sequel/dataset/prepared_statements.rb, line 60
60:       def prepared_sql
61:         return @prepared_sql if @prepared_sql
62:         @prepared_args ||= []
63:         @prepared_sql = super
64:         @opts[:sql] = @prepared_sql
65:         @prepared_sql
66:       end

Protected Instance methods

Return a hash with the same values as the given hash, but with the keys converted to strings.

[Source]

     # File lib/sequel/adapters/sqlite.rb, line 290
290:         def map_to_prepared_args(hash)
291:           args = {}
292:           hash.each{|k,v| args[k.to_s.gsub('.', '__')] = v}
293:           args
294:         end

[Validate]