module Sequel::Postgres::AutoParameterize::DatabaseMethods

  1. lib/sequel/extensions/pg_auto_parameterize.rb

Methods

Public Class

  1. extended

Public Instance

  1. execute

Public Class methods

extended(db)
[show source]
    # File lib/sequel/extensions/pg_auto_parameterize.rb
200 def self.extended(db)
201   unless (db.adapter_scheme == :postgres && USES_PG) || (db.adapter_scheme == :mock && db.database_type == :postgres)
202     raise Error, "pg_auto_parameterize is only supported when using the postgres adapter with the pg driver"
203   end
204   db.extend_datasets(DatasetMethods)
205 end

Public Instance methods

execute(sql, opts={})

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

[show source]
    # File lib/sequel/extensions/pg_auto_parameterize.rb
209 def execute(sql, opts={})
210   if sql.is_a?(QueryString) && (args = sql.args)
211     opts = opts.merge(:arguments=>args)
212   end
213   super
214 end