Module Sequel::Swift::Postgres::DatabaseMethods
In: lib/sequel/adapters/swift/postgres.rb

Methods to add to Database instances that access PostgreSQL via Swift.

Methods

Included Modules

Sequel::Postgres::DatabaseMethods

Public Class methods

Add the primary_keys and primary_key_sequences instance variables, so we can get the correct return values for inserted rows.

[Source]

    # 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

Public Instance methods

Return instance of Sequel::Swift::Postgres::Dataset with the given opts.

[Source]

    # 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.

[Source]

    # 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.

[Source]

    # 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

[Validate]