Module: Sequel::Plugins::PreparedStatementsSafe::ClassMethods

Defined in:
lib/sequel/plugins/prepared_statements_safe.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#prepared_statements_column_defaultsObject (readonly)

A hash with column symbol keys and default values. Instance values are merged into this hash before creating to reduce the number of free columns (columns that may or may not be present in the INSERT statement), as the number of prepared statements that can be created is 2^N (where N is the number of free columns).



37
38
39
# File 'lib/sequel/plugins/prepared_statements_safe.rb', line 37

def prepared_statements_column_defaults
  @prepared_statements_column_defaults
end

Instance Method Details

#freezeObject

Freeze the prepared statements column defaults when freezing the model class.



43
44
45
46
47
# File 'lib/sequel/plugins/prepared_statements_safe.rb', line 43

def freeze
  @prepared_statements_column_defaults.freeze if @prepared_statements_column_defaults

  super
end