Skip to content

Support more underscore keys in DSN

For improved DSN compatibility, the following keys have been added:

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

Their values are passed as-is to exec for their respective PRAGMAs and not validated in any way.

Based on the previous work on DSN pragmas, it looks to be considered safe so no additional checks were added. The compatibility here is intended when switching between modernc.org/sqlite and mattn/go-sqlite3 where it is handy to have higher DSN compatibility and to avoid dangerous mistakes like not having foreign keys enabled.

Merge request reports

Loading