module Sequel::Dataset::ArgumentMapper

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).

Public Instance Methods

bind_arguments() click to toggle source

The bind arguments to use for running this prepared statement

   # File lib/sequel/dataset/prepared_statements.rb
50 def bind_arguments
51   @opts[:bind_arguments]
52 end
call(bind_vars=OPTS, &block) click to toggle source

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

   # File lib/sequel/dataset/prepared_statements.rb
55 def call(bind_vars=OPTS, &block)
56   sql = prepared_sql
57   prepared_args.freeze
58   ps = bind(bind_vars)
59   ps.clone(:bind_arguments=>ps.map_to_prepared_args(ps.opts[:bind_vars]), :sql=>sql, :prepared_sql=>sql).run(&block)
60 end
prepared_sql() click to toggle source

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

Calls superclass method
   # File lib/sequel/dataset/prepared_statements.rb
64 def prepared_sql
65   if sql = @opts[:prepared_sql] || cache_get(:_prepared_sql)
66     return sql
67   end
68   cache_set(:_prepared_sql, super)
69 end
prepared_statement_name() click to toggle source

The name of the prepared statement, if any.

   # File lib/sequel/dataset/prepared_statements.rb
45 def prepared_statement_name
46   @opts[:prepared_statement_name]
47 end

Private Instance Methods

emulate_prepared_statements?() click to toggle source

Report that prepared statements are not emulated, since all adapters that use this use native prepared statements.

   # File lib/sequel/dataset/prepared_statements.rb
75 def emulate_prepared_statements?
76   false
77 end