module PG

The top-level PG namespace.

Constants

REVISION

VCS revision

VERSION

Library version

Public Class Methods

connect( *args ) click to toggle source

Convenience alias for PG::Connection.new.

# File lib/pg.rb, line 39
def self::connect( *args )
        return PG::Connection.new( *args )
end
isthreadsafe → Boolean click to toggle source
is_threadsafe? → Boolean
threadsafe? → Boolean

Returns true if libpq is thread-safe, false otherwise.

static VALUE
pg_s_threadsafe_p(VALUE self)
{
        UNUSED( self );
        return PQisthreadsafe() ? Qtrue : Qfalse;
}
library_version → Integer click to toggle source

Get the version of the libpq library in use. The number is formed by converting the major, minor, and revision numbers into two-decimal- digit numbers and appending them together. For example, version 7.4.2 will be returned as 70402, and version 8.1 will be returned as 80100 (leading zeroes are not shown). Zero is returned if the connection is bad.

static VALUE
pg_s_library_version(VALUE self)
{
        UNUSED( self );
        return INT2NUM(PQlibVersion());
}
version_string( include_buildnum=false ) click to toggle source

Get the PG library version. If include_buildnum is true, include the build ID.

# File lib/pg.rb, line 31
def self::version_string( include_buildnum=false )
        vstring = "%s %s" % [ self.name, VERSION ]
        vstring << " (build %s)" % [ REVISION[/: ([[:xdigit:]]+)/, 1] || '0' ] if include_buildnum
        return vstring
end