Module | Sequel::Plugins::PreparedStatementsWithPk
In: | lib/sequel/plugins/prepared_statements_with_pk.rb

The prepared_statements_with_pk plugin allows Dataset#with_pk for model datasets to use prepared statements by extract the values of previously bound variables using `Dataset#unbind`, and attempting to use a prepared statement if the variables can be unbound correctly. See `Unbinder` for details about what types of dataset filters can be unbound correctly.

This plugin depends on the `prepared_statements` plugin and should be considered unsafe. Unbinding dataset values cannot be done correctly in all cases, and use of this plugin in cases where not there are variables that are not unbound can lead to an denial of service attack by allocating an arbitrary number of prepared statements. You have been warned.

Usage:

      # Make all model subclasses use prepared statements for Dataset#with_pk (called before loading subclasses)
      Sequel::Model.plugin :prepared_statements_with_pk

      # Make the Album class use prepared statements for Dataset#with_pk
      Album.plugin :prepared_statements_with_pk

### Methods

apply

### Classes and Modules

Module Sequel::Plugins::PreparedStatementsWithPk::ClassMethods
Module Sequel::Plugins::PreparedStatementsWithPk::DatasetMethods

### Public Class methods

apply(model)

Depend on the prepared_statements plugin

[Source]

        # File lib/sequel/plugins/prepared_statements_with_pk.rb, line 24
    24:       def self.apply(model)
    25:         model.plugin(:prepared_statements)
    26:       end

[Validate]