module Sequel::Plugins::PreparedStatementsWithPk::ClassMethods
Private Instance Methods
prepared_lookup_dataset(ds)
click to toggle source
Return a prepared statement that can be used to lookup a row given a dataset for the row matching the primary key.
# File lib/sequel/plugins/prepared_statements_with_pk.rb, line 41 def prepared_lookup_dataset(ds) cached_prepared_statement(:lookup_sql, ds.sql){prepare_statement(ds.where(prepared_statement_key_array(primary_key).map{|k, v| [SQL::QualifiedIdentifier.new(ds.model.table_name, k), v]}), :first)} end