Module | Sequel::Swift::Postgres::DatabaseMethods |
In: |
lib/sequel/adapters/swift/postgres.rb
|
Add the primary_keys and primary_key_sequences instance variables, so we can get the correct return values for inserted rows.
# File lib/sequel/adapters/swift/postgres.rb, line 37 37: def self.extended(db) 38: db.instance_eval do 39: @primary_keys = {} 40: @primary_key_sequences = {} 41: end 42: end
Return instance of Sequel::Swift::Postgres::Dataset with the given opts.
# File lib/sequel/adapters/swift/postgres.rb, line 45 45: def dataset(opts=nil) 46: Sequel::Swift::Postgres::Dataset.new(self, opts) 47: end
Run the DELETE/UPDATE SQL on the database and return the number of matched rows.
# File lib/sequel/adapters/swift/postgres.rb, line 51 51: def execute_dui(sql, opts={}) 52: synchronize(opts[:server]) do |conn| 53: begin 54: conn.execute(sql) 55: rescue SwiftError => e 56: raise_error(e) 57: end 58: end 59: end
Run the INSERT SQL on the database and return the primary key for the record.
# File lib/sequel/adapters/swift/postgres.rb, line 63 63: def execute_insert(sql, opts={}) 64: synchronize(opts[:server]) do |conn| 65: conn.execute(sql) 66: insert_result(conn, opts[:table], opts[:values]) 67: end 68: end