Skip to main content

Module store

Module store 

Source
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 migrate must then refuse to choose between.