module Sequel::Plugins::PreparedStatementsSafe

  1. lib/sequel/plugins/prepared_statements_safe.rb

The prepared_statements_safe plugin modifies the model to reduce the number of prepared statements that can be created, by setting as many columns as possible before creating, and by changing save_changes to save all columns instead of just the changed ones. This plugin exists for backwards compatibility and is not recommended for general use.

This plugin depends on the prepared_statements plugin.

Usage:

# Make all model subclasses more safe when using prepared statements (called before loading subclasses)
Sequel::Model.plugin :prepared_statements_safe

# Make the Album class more safe when using prepared statements
Album.plugin :prepared_statements_safe

Methods

Public Class

  1. apply
  2. configure

Public Class methods

apply(model)

Depend on the prepared_statements plugin

[show source]
   # File lib/sequel/plugins/prepared_statements_safe.rb
22 def self.apply(model)
23   model.plugin(:prepared_statements)
24 end
configure(model)

Set the column defaults to use when creating on the model.

[show source]
   # File lib/sequel/plugins/prepared_statements_safe.rb
27 def self.configure(model)
28   model.send(:set_prepared_statements_column_defaults)
29 end