module Sequel::Swift::Postgres::DatabaseMethods
Methods to add to Database instances that access PostgreSQL via Swift.
Public Class Methods
extended(db)
click to toggle source
Add the primary_keys and primary_key_sequences instance variables, so we can get the correct return values for inserted rows.
Calls superclass method
# File lib/sequel/adapters/swift/postgres.rb, line 18 def self.extended(db) super db.send(:initialize_postgres_adapter) end
Private Instance Methods
server_opts(o)
click to toggle source
Remove all other options except for ones specifically handled, as otherwise swift passes them to dbic++ which passes them to PostgreSQL which can raise an error.
Calls superclass method
# File lib/sequel/adapters/swift/postgres.rb, line 28 def server_opts(o) o = super so = {} [:db, :user, :password, :host, :port].each{|s| so[s] = o[s] if o.has_key?(s)} so end
setup_connection(conn)
click to toggle source
Extend the adapter with the Swift PostgreSQL AdapterMethods.
Calls superclass method
# File lib/sequel/adapters/swift/postgres.rb, line 36 def setup_connection(conn) conn = super(conn) conn.native_bind_format = true connection_configuration_sqls.each{|sql| log_yield(sql){conn.execute(sql)}} conn end