package
Version:
v0.1.5
Opens a new window with list of versions in this module.
Published: Apr 21, 2026
License: MIT
Opens a new window with license information.
Imports: 6
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package pgx provides pgx pool helpers for Postgres.
Package pgx 提供 Postgres 的 pgx 连接池辅助函数。
BuildDSN returns the Postgres DSN for cfg.
BuildDSN 返回 cfg 的 Postgres DSN。
NewPool returns a pgx connection pool.
Call NewPool(ctx, Config{...}).
NewPool 返回 pgx 连接池。
调用 NewPool(ctx, Config{...})。
Example / 示例:
pool, _ := pgx.NewPool(ctx, pgx.Config{Host: "localhost", Port: 5432, User: "app", Name: "db"})
Ping checks pool connectivity.
Ping 检查连接池连通性。
Config configures NewPool.
Config 配置 NewPool。
Source Files
¶
Click to show internal directories.
Click to hide internal directories.