Documentation
¶
Overview ¶
Package storage wraps the local SQLite database (WAL mode).
A pure-Go driver (modernc.org/sqlite) is used so the binary cross-compiles to linux/arm64 without a C toolchain, which the design doc requires for deploying to Orange Pi / Raspberry Pi nodes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Migrate ¶
Migrate applies pending schema migrations and advances PRAGMA user_version. It is safe to call repeatedly: already-applied versions are skipped.
Migrations are defined in migrations.go. Each migration runs in its own transaction and updates user_version on success so a partially failed run can be retried without double-applying earlier steps.
func Now ¶
func Now() int64
Now returns Unix seconds; SQLite timestamps are stored as epoch seconds.
func Open ¶
Open opens (or creates) the SQLite database at path in WAL mode. The parent directory is created automatically so callers never hit SQLITE_CANTOPEN (error 14) because a parent directory was missing — this is the most common first-run failure when `panda` is invoked from any directory other than the project root.