module Sequel::Dataset::ArgumentMapper

def call(bind_vars={}, &block)

Set the bind arguments based on the hash and call super.
def call(bind_vars={}, &block)
  ds = bind(bind_vars)
  ds.prepared_sql
  ds.bind_arguments = ds.map_to_prepared_args(ds.opts[:bind_vars])
  ds.run(&block)
end

def prepared_sql

cache the result of the sql.
Override the given *_sql method based on the type, and
def prepared_sql
  return @prepared_sql if @prepared_sql
  @prepared_args ||= []
  @prepared_sql = super
  @opts[:sql] = @prepared_sql
  @prepared_sql
end