Module | Sequel::Plugins::PreparedStatements
In: | lib/sequel/plugins/prepared_statements.rb

The prepared_statements plugin modifies the model to use prepared statements for instance level deletes and saves, as well as class level lookups by primary key.

Note that this plugin is unsafe in some circumstances, as it can allow up to 2^N prepared statements to be created for each type of insert and update query, where N is the number of colums in the table. It is recommended that you use the `prepared_statements_safe` plugin in addition to this plugin to reduce the number of prepared statements that can be created, unless you tightly control how your model instances are saved.

This plugin probably does not work correctly with the instance filters plugin.

Usage:

      # Make all model subclasses use prepared statements  (called before loading subclasses)
      Sequel::Model.plugin :prepared_statements

      # Make the Album class use prepared statements
      Album.plugin :prepared_statements

### Methods

apply

### Classes and Modules

Module Sequel::Plugins::PreparedStatements::ClassMethods
Module Sequel::Plugins::PreparedStatements::InstanceMethods

### Constants

MUTEX | = | Mutex.new |  | Synchronize access to the integer sequence so that no two calls get the same integer.
NEXT | = | lambda{MUTEX.synchronize{i += 1}} |  | This plugin names prepared statements uniquely using an integer sequence, this lambda returns the next integer to use.

### Public Class methods

apply(model)

Setup the datastructure used to hold the prepared statements in the model.

[Source]

        # File lib/sequel/plugins/prepared_statements.rb, line 33
    33:       def self.apply(model)
    34:         model.instance_variable_set(:@prepared_statements, :insert=>{}, :insert_select=>{}, :update=>{}, :lookup_sql=>{})
    35:       end

[Validate]