class

PG::Connection

Inherits PG::EscapeHelper / DB::Connection / DB::BeginTransaction / DB::SessionMethods / DB::QueryMethods / DB::Disposable / Reference / Object

Constructors

new(options : DB::Connection::Options, conn_info : PQ::ConnInfo)
Source
new(options : DB::Connection::Options, connection : PQ::Connection)
Source

Instance methods

build_prepared_statement(query) : Statement

:nodoc:

Source
build_unprepared_statement(query) : Statement

:nodoc:

Source
clear_time_zone_cache

Clears the cache for situations where the tzdata file has changed

Source
exec_all(query : String) : Nil

Execute several statements. No results are returned.

Source
exec_copy(query : String) : CopyResult

Execute a "COPY" query and return an IO object to read from or write to, depending on the query.

data = conn.exec_copy("COPY table TO STDOUT").gets_to_end
writer = conn.exec_copy "COPY table FROM STDIN")
writer << data
writer.close
Source
on_notice

Set the callback block for notices and errors.

Source
on_notification

Set the callback block for notifications from Listen/Notify.

Source
time_zone
Source
version
Source