@hachej/boring-files 0.2.5 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +1 -1
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -22,7 +22,7 @@ Receipts are scoped by workspace identity, principal, scope and initiator. Ident
22
22
 
23
23
  `@hachej/boring-files/sqlite` exports `openNodeConnection(filename, settings?)` (a `node:sqlite` file as a `SqliteConnection`) and `openNodeDatabase(filename, settings?)` (the configured `DatabaseSync`, for Pi's public adapter: `SqliteStorage.open(new NodeSqliteDatabase(openNodeDatabase(file, settings)))`). `settings` is `SqliteSettings` `{ journalMode?: 'wal' | 'delete' | 'truncate' | 'persist', lockingMode?: 'normal' | 'exclusive', busyTimeoutMs?, synchronous?: 'off' | 'normal' | 'full' | 'extra', tempStore?: 'default' | 'file' | 'memory' }`; missing fields come from `sqliteSettings.localDisk` (WAL, normal locking, 5 s busy timeout, full sync: the behaviour before settings existed). `sqliteSettings.networkFilesystem` is for one process owning a file on NFS such as EFS: rollback journal, `exclusive` locking with the lock taken at open, 10 s busy timeout, full sync, temporary tables in memory; another connection to that file fails with `SqliteLockedError` (`code: 'sqlite-locked'`) after its busy timeout. Names and values are allow-listed (`TypeError` otherwise, before the file is opened); there is no free-form pragma. The settings live in `@hachej/boring-files/sqlite-settings` (pure, browser-safe; `sqlitePragmas(settings)` is what the browser's SQLite Wasm uses), and `npm run check` refuses `PRAGMA journal_mode`/`locking_mode` assignments anywhere else. The journal, the metering ledger and the SQLite file system borrow a connection and never set pragmas.
24
24
 
25
- `@hachej/boring-files/sqlite-filesystem` exports `openSqliteFileSystem({ connection, workspace, cwd })`: a Pi `FileSystem` whose regular files and directories are rows of one workspace in a `SqliteConnection` (`openNodeConnection`, `durableObjectSqliteConnection`, or `openBrowserSqliteConnection` from the private, unpublished `@hachej/boring-browser/sqlite`, available only inside this monorepo), with the `incarnation` of those rows. Like Pi's `NodeExecutionEnv` (which Pi's `write` tool relies on), `writeFile` creates missing parent directories; a parent that is a file still fails. Given to `createWorkspaceProvider` it is the SQLite workspace backend ([One place for files](../../docs/architecture/FILES-GIT-EXEC.md#one-place-for-files)): multi-file conditional batches commit in one transaction, together with the receipt when the journal uses the same connection. It implements Pi 1.1's full `FileSystem` (positional readers whose `scanLines` is Pi's own `LineScanner`, paged directory readers, and a polling `watch`) and answers with Pi's own `FileError`s, so this entry loads `@earendil-works/pi-durable/env` (Pi's portable contracts, no engine): install `@earendil-works/pi-durable` with it. The other entries of this package do not need Pi.
25
+ `@hachej/boring-files/sqlite-filesystem` exports `openSqliteFileSystem({ connection, workspace, cwd })`: a Pi `FileSystem` whose regular files and directories are rows of one workspace in a `SqliteConnection` (`openNodeConnection`, `durableObjectSqliteConnection`, or `openBrowserSqliteConnection` from the private, unpublished `@hachej/boring-browser/sqlite`, available only inside this monorepo), with the `incarnation` of those rows. Like Pi's `NodeExecutionEnv` (which Pi's `write` tool relies on), `writeFile` creates missing parent directories; a parent that is a file still fails. Given to `createWorkspaceProvider` it is the SQLite workspace backend ([One place for files](../../docs/architecture/FILES-GIT-EXEC.md#one-place-for-files)): multi-file conditional batches commit in one transaction, together with the receipt when the journal uses the same connection. It implements Pi 1.2's full `FileSystem` (positional readers whose `scanLines` is Pi's own `LineScanner`, paged directory readers, and a polling `watch`) and answers with Pi's own `FileError`s, so this entry loads `@earendil-works/pi-durable/env` (Pi's portable contracts, no engine): install `@earendil-works/pi-durable` with it. The other entries of this package do not need Pi.
26
26
 
27
27
  See [scaffold guide](../../docs/contracts/SCAFFOLD.md) and [resource design](../../docs/architecture/FILES-GIT-EXEC.md).
28
28
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hachej/boring-files",
3
- "version": "0.2.5",
3
+ "version": "0.3.1",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "type": "module",
@@ -89,8 +89,8 @@
89
89
  },
90
90
  "peerDependencies": {
91
91
  "isomorphic-git": "^1.42.6",
92
- "@earendil-works/pi-durable": "~1.1.0",
93
- "@earendil-works/chord": "~1.1.0"
92
+ "@earendil-works/pi-durable": "~1.2.0",
93
+ "@earendil-works/chord": "~1.2.0"
94
94
  },
95
95
  "peerDependenciesMeta": {
96
96
  "isomorphic-git": {