PG::Connection
Inherits PG::EscapeHelper < DB::Connection < DB::BeginTransaction < DB::SessionMethods < DB::QueryMethods < DB::Disposable < Reference < Object
Constructors
new(options : DB::Connection::Options, connection : PQ::Connection)
SourceInstance methods
driver_name
Returns the canonical name of the driver backing this connection.
The value is always one of the names the driver registers with DB.register_driver (e.g. "postgres", "mysql", "sqlite3").
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
server_name
Returns the product name the server identifies as (e.g. "PostgreSQL", "MariaDB"), or nil if the driver can't tell.
server_version
Returns the version string as reported by the server, unparsed (e.g. "8.4.9", "12.2.2-MariaDB-ubu2404"), or nil if the driver can't tell.
The format is server-specific.
time_zone
Sourceversion
Source