Documentation ¶
Index ¶
- Constants
- func OpenDB(ctx context.Context, c pgx.ConnConfig, opts Options) (*blockysql.DB, error)
- type DB
- func (d *DB) DB() *sql.DB
- func (d *DB) Dialect() string
- func (d *DB) DriverName() string
- func (d *DB) ErrorCode(err error) bserr.Code
- func (d *DB) ErrorColumn(err error) string
- func (d *DB) ErrorConstraint(err error) string
- func (d *DB) ErrorTable(err error) string
- func (d *DB) HasErrorDetails() bool
- type Options
- type URLOpener
Constants ¶
const SchemaName = "pgx"
SchemaName is the name of the driver.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB is the driver for the PostgreSQL database.
func (*DB) ErrorColumn ¶
ErrorColumn returns the column name of the given error if the driver doesn't support it, it should return an empty string.
func (*DB) ErrorConstraint ¶
ErrorConstraint returns the constraint name of the given error if the driver doesn't support it, it should return an empty string.
func (*DB) ErrorTable ¶
ErrorTable returns the table name of the given error if the driver doesn't support it, it should return an empty string.
func (*DB) HasErrorDetails ¶
HasErrorDetails returns true if the driver supports error details, such as column, table and constraint name.
type Options ¶
type Options struct { // TraceOpts contains options for OpenCensus. TraceOpts []ocsql.TraceOption // OpenDBOpts contains options for configuring the database connection. OpenDBOpts []stdlib.OptionOpenDB }
Options contains options for configuring the database connection.
type URLOpener ¶
type URLOpener struct { // TraceOpts contains options for OpenCensus. TraceOpts []ocsql.TraceOption // OpenDBOpts contains options for the pgx driver. OpenDBOpts []stdlib.OptionOpenDB }
URLOpener opens PostgreSQL URLs like "pgx://user:password@host/dbname?option=value". For details see https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING. This driver supports runtime configurable parameters as defined in https://www.postgresql.org/docs/current/runtime-config.html. I.e.:
- search_path (string) - Sets the schema search order for names that are not schema-qualified.
- timezone (string) - Sets the time zone for displaying and interpreting time stamps.