Documentation
¶
Overview ¶
Package pgx provides a typed Config for PostgreSQL connections that produces a DSN string consumable by core/sql.New, registering the pgx stdlib driver.
Importing this package registers github.com/jackc/pgx/v5/stdlib via blank import under the database/sql driver name "pgx", so consuming code does not need a separate driver import. pgx is the standard PostgreSQL driver for core consumers — chosen for richer Postgres type support (NUMERIC, arrays), proper context-cancellation of in-flight queries, and libraries that assume pgx (such as River's database/sql driver).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Host string
Port string
User string
Password string
Name string
// SSLMode follows libpq conventions: "disable", "require",
// "verify-ca", "verify-full". Defaults to "disable" when empty.
SSLMode string
}
Config describes a PostgreSQL connection. Plain fields, no struct tags — consumer apps map their viper keys to fields explicitly inside their own config.NewConfig().