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 |
# File 'lib/sequel/extensions/pg_auto_parameterize.rb', line 93 def self.extended(db) 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.
99 100 101 102 103 104 |
# File 'lib/sequel/extensions/pg_auto_parameterize.rb', line 99 def execute(sql, opts={}) if sql.is_a?(StringWithArray) && (args = sql.args) opts = opts.merge(:arguments=>args) end super end |