class PGconn

Attributes

db[R]
host[R]
user[R]

Public Class Methods

escape(str) click to toggle source
# File lib/postgres-pr/postgres-compat.rb, line 42
def self.escape(str)
  str.gsub("'","''").gsub("\\", "\\\\\\\\")
end
new(host, port, options, tty, database, user, auth) click to toggle source
# File lib/postgres-pr/postgres-compat.rb, line 11
def initialize(host, port, options, tty, database, user, auth)
  uri =
  if host.nil?
    nil
  elsif host[0] != ?/
    "tcp://#{ host }:#{ port }"
  else
    "unix:#{ host }/.s.PGSQL.#{ port }"
  end
  @host = host
  @db = database
  @user = user
  @conn = PostgresPR::Connection.new(database, user, auth, uri)
end
quote_ident(name) click to toggle source
# File lib/postgres-pr/postgres-compat.rb, line 54
def self.quote_ident(name)
  %("#{name}")
end

Public Instance Methods

close() click to toggle source
# File lib/postgres-pr/postgres-compat.rb, line 26
def close
  @conn.close
end
exec(sql)
Alias for: query
notice_processor() click to toggle source
# File lib/postgres-pr/postgres-compat.rb, line 46
def notice_processor
  @conn.notice_processor
end
notice_processor=(np) click to toggle source
# File lib/postgres-pr/postgres-compat.rb, line 50
def notice_processor=(np)
  @conn.notice_processor = np
end
query(sql) click to toggle source
# File lib/postgres-pr/postgres-compat.rb, line 32
def query(sql)
  PGresult.new(@conn.query(sql))
end
Also aliased as: exec
transaction_status() click to toggle source
# File lib/postgres-pr/postgres-compat.rb, line 38
def transaction_status
  @conn.transaction_status
end