Module: Sequel::Postgres::AutoParameterize::DatabaseMethods
- Defined in:
- lib/sequel/extensions/pg_auto_parameterize.rb
Class Method Summary collapse
-
.extended(db) ⇒ Object
Extend the database’s datasets with the necessary code.
Instance Method Summary collapse
-
#execute(sql, opts = {}) ⇒ Object
If the sql string has an embedded parameter array, extract the arguments from that.
Class Method Details
.extended(db) ⇒ Object
Extend the database’s datasets with the necessary code.
93 94 95 96 |
# File 'lib/sequel/extensions/pg_auto_parameterize.rb', line 93 def self.extended(db) Sequel::Deprecation.deprecate('The pg_auto_parameterize extension', 'Please stop loading it') unless defined?(SEQUEL_EXTENSIONS_NO_DEPRECATION_WARNING) db.extend_datasets(DatasetMethods) end |
Instance Method Details
#execute(sql, opts = {}) ⇒ Object
If the sql string has an embedded parameter array, extract the arguments from that.
100 101 102 103 104 105 |
# File 'lib/sequel/extensions/pg_auto_parameterize.rb', line 100 def execute(sql, opts={}) if sql.is_a?(StringWithArray) && (args = sql.args) opts = opts.merge(:arguments=>args) end super end |