Module Sequel::Dataset::ArgumentMapper
In: 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).

Methods

Public Instance methods

The bind arguments to use for running this prepared statement

[Source]

    # File lib/sequel/dataset/prepared_statements.rb, line 50
50:       def bind_arguments
51:         @opts[:bind_arguments]
52:       end

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

[Source]

    # File lib/sequel/dataset/prepared_statements.rb, line 55
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

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 64
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

The name of the prepared statement, if any.

[Source]

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

[Validate]