Module: Sequel::Postgres::AutoParameterize::DatabaseMethods
- Defined in:
- lib/sequel/extensions/pg_auto_parameterize.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#execute(sql, opts = {}) ⇒ Object
If the sql string has an embedded parameter array, extract the parameter values from that.
Class Method Details
.extended(db) ⇒ Object
173 174 175 176 177 178 |
# File 'lib/sequel/extensions/pg_auto_parameterize.rb', line 173 def self.extended(db) unless (db.adapter_scheme == :postgres && USES_PG) || (db.adapter_scheme == :mock && db.database_type == :postgres) raise Error, "pg_auto_parameterize is only supported when using the postgres adapter with the pg driver" end db.extend_datasets(DatasetMethods) end |
Instance Method Details
#execute(sql, opts = {}) ⇒ Object
If the sql string has an embedded parameter array, extract the parameter values from that.
182 183 184 185 186 187 |
# File 'lib/sequel/extensions/pg_auto_parameterize.rb', line 182 def execute(sql, opts={}) if sql.is_a?(QueryString) && (args = sql.args) opts = opts.merge(:arguments=>args) end super end |