module Sequel::Postgres::AutoParameterize::DatabaseMethods

Public Class Methods

extended(db) click to toggle source

Extend the database's datasets with the necessary code.

# File lib/sequel/extensions/pg_auto_parameterize.rb, line 89
def self.extended(db)
  db.extend_datasets(DatasetMethods)
end

Public Instance Methods

execute(sql, opts={}) click to toggle source

If the sql string has an embedded parameter array, extract the arguments from that.

# File lib/sequel/extensions/pg_auto_parameterize.rb, line 95
def execute(sql, opts={})
  if sql.is_a?(StringWithArray) && (args = sql.args)
    opts = opts.merge(:arguments=>args)
  end
  super
end