Documentation
¶
Overview ¶
Package postgrespgxdb provides constructor to connect to postgresql with pgx
Index ¶
Constants ¶
View Source
const ( // SCMPrepare // Statement Cache Mode value - "prepare" - is default SCMPrepare = "prepare" // SCMDescribe // Statement Cache Mode value - "describe" - use it for PGBouncer connections SCMDescribe = "describe" )
View Source
const (
ConstraintErrorCode = "23505"
)
Variables ¶
This section is empty.
Functions ¶
func IsConstraintError ¶ added in v0.0.90
Types ¶
type AffectedLessThenNecessaryError ¶ added in v0.0.90
func (*AffectedLessThenNecessaryError) Error ¶ added in v0.0.90
func (e *AffectedLessThenNecessaryError) Error() string
type Config ¶
type Config struct { Host string Port string Name string User string Password string SSLMode string BinaryParameters string // lib/pq setting for prepared statements in pgbouncer StatementCacheMode string MaxConnections string UseConnectionPooler bool }
Config describe connection params to database
type DBQuery ¶
type DBQuery interface { Exec(ctx context.Context, sql string, arguments ...any) (pgconn.CommandTag, error) Query(ctx context.Context, sql string, optionsAndArgs ...any) (pgx.Rows, error) QueryRow(ctx context.Context, sql string, optionsAndArgs ...any) pgx.Row Begin(ctx context.Context) (pgx.Tx, error) BeginTx(ctx context.Context, txOptions pgx.TxOptions) (pgx.Tx, error) SendBatch(ctx context.Context, b *pgx.Batch) pgx.BatchResults Close() types.SQLLogger }
DBQuery describe interface
Click to show internal directories.
Click to hide internal directories.