Documentation
¶
Overview ¶
Package sqlite opens the SQLite databases hive and Hive Desktop keep, with the DSN and pool settings every caller must agree on.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Open ¶
Open opens the database at path in WAL mode with foreign keys on, applies the pool settings, and pings it. The caller owns migrations and defaults.
Write transactions begin with BEGIN IMMEDIATE (_txlock=immediate). Several writers, in one process or across the CLI and the desktop, run transactions that read before they write. With the driver default (deferred), two such transactions can both hold a read lock and then both try to upgrade to the write lock. SQLite resolves that deadlock by returning SQLITE_BUSY at once and ignoring busy_timeout, because waiting could never succeed. IMMEDIATE takes the write lock up front, so a second writer waits on busy_timeout instead of failing.