Documentation
¶
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 int
User string
Password string
Database string
// SSLMode: "disable" (local dev), "require", "verify-ca", "verify-full".
SSLMode string
// Pool tuning. Zero means "use database/sql defaults".
MaxOpenConns int
MaxIdleConns int
ConnMaxLifetime time.Duration
}
Config describes how to open a PostgreSQL database.
type DB ¶
DB wraps *sql.DB. Embedding promotes all standard methods so the framework's Database contract is satisfied directly.
func Open ¶
Open builds the DSN, opens the pool, applies tuning, and verifies connectivity. sql.Open itself is lazy — Ping is the real check.
func (*DB) Rebind ¶
Rebind converts ? placeholders to PostgreSQL's positional $1, $2, ... Apps write portable "?" SQL; this makes it Postgres-native.
Note: this is a sequential replacement and does NOT skip ? inside quoted string literals. Parameterized queries never place a literal ? there, so in practice this is safe — the same tradeoff sqlx makes.