Categorygithub.com/powerman/pqx
modulepackage
0.7.0
Repository: https://github.com/powerman/pqx.git
Documentation: pkg.go.dev

# README

pqx GoDoc Go Report Card CircleCI Coverage Status Latest Release

Helpers for use with Go Postgres driver github.com/lib/pq.

# Functions

EnsureTempDB will drop/create new temporary db with suffix in db name and return opened temporary db together with cleanup func which will close and drop temporary db.
IsSerializationFailure returns a boolean indicating whether the error is 40001 (serialization_failure).
KeepAliveDial returns hook which adds TCP keepalives.
Serialize executes given func, which is supposed to run single transaction and return (possibly wrapped) error if transaction fail.

# Constants

Only try a non-SSL connection.
Only try an SSL connection.
Only try an SSL connection, and verify that the server certificate is issued by a trusted certificate authority (CA).
Only try an SSL connection, verify that the server certificate is issued by a trusted CA and that the requested server host name matches that in the certificate.

# Variables

Dial is a hook which should be set before connecting to PostgreSQL server using "pqx" driver.

# Structs

Config described connection parameters for github.com/lib/pq.

# Interfaces

Logger interface consumed by this package.

# Type aliases

DialFunc used to open new connections to PostgreSQL server.
SSLMode determines whether or with what priority a secure SSL TCP/IP connection will be negotiated with the server..