Support more underscore keys in DSN (continues !73)

Carries !73 forward per @cznic's go-ahead. Toni Spets's original commit is preserved as-authored; I rebased it onto current master (SQLite 3.53.3) and added a follow-up that documents the keys in the driver DSN reference, notes the fixed apply order at the query_only call site, and adds a combined-DSN test.

Adds mattn/go-sqlite3-compatible DSN shorthand keys, each passing its value as-is to the corresponding PRAGMA:

  • _foreign_keys | _fk
  • _busy_timeout | _timeout
  • _journal_mode | _journal
  • _synchronous | _sync
  • _auto_vacuum | _vacuum
  • _query_only

On the ordering Toni flagged: busy_timeout is applied first and query_only last. On a fresh empty database query_only does not actually block the other init pragmas (it blocks DML/DDL), so a fail-on-reorder assertion is not clean for these keys; the apply order is enforced by code order + documented, and TestDSNPragmas ("Test combined DSN") verifies the keys coexist in a single DSN independent of textual order.

gofmt and go vet clean, go test -run TestDSNPragmas -race passes. Supersedes !73.

Merge request reports

Loading