Expand description
The workshop’s one database, $PRJ/.state/wsb.db
(wsb_prj::database_path).
Everything wsb keeps in a database is in this one file: the workshop’s agent sessions, every worktree’s test catalogue and workbench layout (each row keyed by its worktree), the GitHub mirror’s tables and the peers’. No worktree, worktree or host folder holds a database of its own, and nothing in one is ever committed.
Opened once per process: every command and every route of the daemon shares one pool, and the schema is brought up to date once.
Functions§
- older_
databases - The databases an older wsb kept for the workshop, while any is still there: the workshop’s sessions in its own folder, its peers, and the workshop’s GitHub mirror.
- open
- The database, opened — once per process for each place it can be, so a
test pointing the workshop somewhere of its own gets that workshop’s.
Refused while an older wsb’s databases remain (
require_current_layout). - open_
for_ migration - The database, opened whatever else is there:
wsb migrate’s, which is what brings the older databases into it. - path
- Where the database is.
- require_
current_ layout - Refuse to go on while an older wsb’s databases are there. Anything this
wsb wrote first would be a second database
wsb migratemust then refuse to choose between.