Keep the empty host when the db_url path starts with //
check / check (push) Waiting to run

defaultDBURL kept the empty host only when state_dir started with //,
but SQLite reads the path written into the URL, state_dir followed by
/state.sqlite3. For a state_dir of / that path is //state.sqlite3, the
URL started file:// and SQLite read state.sqlite3 as a host, so pixa
failed to start. The decision now looks at that path: a state_dir of
/ gives file:////state.sqlite3. Every other state_dir gives the same
URL as before.

Model: opus-5-5
This commit is contained in:
2026-10-16 02:28:59 +00:00
parent 339c149a4e
commit 78fe6957de
3 changed files with 24 additions and 20 deletions
+7 -7
View File
@@ -726,13 +726,13 @@ Key settings in more detail:
- `db_url` — the SQLite database to open; omitted, it is
`file:<state_dir>/state.sqlite3?_pragma=journal_mode(WAL)`, which keeps the
database in WAL mode. `state_dir` is percent-encoded in it, so a `%`, `?` or
`#` in the name is written as `%25`, `%3F` or `%23`. For a `state_dir`
starting with `//` it starts `file:////`, so SQLite does not read the first
directory name as a host. pixa opens one connection to it, so its own reads
and writes run one at a time. pixa adds `_pragma=busy_timeout(5000)` to any
`db_url`, so a write that finds another program writing to the file waits up
to five seconds for it instead of failing. WAL mode comes only from the URL:
keep `_pragma=journal_mode(WAL)` in one you set
`#` in the name is written as `%25`, `%3F` or `%23`. For a `state_dir` of `/`
or one starting with `//` it starts `file:////`, so SQLite does not read the
first name in the path as a host. pixa opens one connection to it, so its own
reads and writes run one at a time. pixa adds `_pragma=busy_timeout(5000)` to
any `db_url`, so a write that finds another program writing to the file waits
up to five seconds for it instead of failing. WAL mode comes only from the
URL: keep `_pragma=journal_mode(WAL)` in one you set
- `cache_max_bytes` — disk cache size limit in bytes; `0` disables the disk
cache entirely; omitted defaults to 75% of the sum of the free space on the
filesystem containing `<state_dir>/cache/` and the bytes of source and