You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every mattn _* DSN flag and the PRAGMA it translates to, plus the URI-level flags and _strict mode.
sidebar
order
23
DSN flag compatibility
Every _* DSN flag mattn supported is translated transparently — usually into the equivalent PRAGMA. _strict=1 turns any unknown flag into an error (helpful during migration to flush typos out). The modern alternative to DSN strings is the typed sqlite.Config.
For new code, prefer the typed sqlite.Config over a DSN string — it's compile-checked and self-documenting. The common flags map to fields on Config.Pragmas (with typed enum values); anything without a dedicated field goes through Pragmas.Extra, which fires PRAGMA <key> = <value> exactly like _pragma=.
Typed-only (no legacy DSN flag): Pragmas.TempStore (TempStoreMemory · TempStoreFile · TempStoreDefault) and Pragmas.AutoVacuum (AutoVacuumNone · AutoVacuumFull · AutoVacuumIncremental). Transparent at-rest encryption is opened via crypto.Open (the separate vfs/crypto module), not a DSN flag. Config.Pragmas is applied in struct-declaration order after open; RecommendedPragmas() is the production preset (WAL + busy_timeout=5s + foreign_keys=on). Full field semantics live in the Configuration guide and pkg.go.dev/gosqlite.org.