Class: PGconn

### Home Classes Methods

### In Files

- lib/postgres-pr/postgres-compat.rb

### Parent

Object

### Methods

- ::escape
- ::new
- ::quote_ident
- #close
- #exec
- #notice_processor
- #notice_processor=
- #query
- #transaction_status

### Files

- 1q

### Class/Module Index

Quicksearch

- PostgresPR
- PostgresPR::Authentification
- PostgresPR::AuthentificationClearTextPassword
- PostgresPR::AuthentificationCryptPassword
- PostgresPR::AuthentificationKerberosV4
- PostgresPR::AuthentificationKerberosV5
- PostgresPR::AuthentificationMD5Password
- PostgresPR::AuthentificationOk
- PostgresPR::AuthentificationSCMCredential
- PostgresPR::BackendKeyData
- PostgresPR::CommandComplete
- PostgresPR::Connection
- PostgresPR::Connection::Result
- PostgresPR::CopyInResponse
- PostgresPR::CopyOutResponse
- PostgresPR::DataRow
- PostgresPR::DumpError
- PostgresPR::EmptyQueryResponse
- PostgresPR::ErrorResponse
- PostgresPR::Message
- PostgresPR::NoticeErrorMixin
- PostgresPR::NoticeResponse
- PostgresPR::ParameterStatus
- PostgresPR::Parse
- PostgresPR::ParseComplete
- PostgresPR::ParseError
- PostgresPR::PasswordMessage
- PostgresPR::Query
- PostgresPR::ReadyForQuery
- PostgresPR::RowDescription
- PostgresPR::RowDescription::FieldInfo
- PostgresPR::SSLRequest
- PostgresPR::SaltedAuthentificationMixin
- PostgresPR::StartupMessage
- PostgresPR::Terminate
- PostgresPR::UnknownAuthType
- PostgresPR::UnknownMessageType
- Buffer
- Buffer::EOF
- Buffer::Error
- Postgres
- Postgres::Conversion
- Postgres::Conversion::ConversionError
- BinaryReaderMixin
- BinaryWriterMixin
- ByteOrder
- IO
- PGError
- PGconn
- PGresult
- TC_Conversion

No matching classes.

# 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) click to toggle source
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

[Validate]

Generated with the Darkfish Rdoc Generator 2.