@mailwoman/sqlite 10.8.0 → 11.1.0
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.
- package/README.md +1 -1
- package/lib/batched.ts +5 -6
- package/lib/client.ts +4 -7
- package/lib/database-schema.ts +3 -4
- package/lib/dialect/config.ts +3 -6
- package/lib/dialect.ts +2 -5
- package/lib/driver.ts +2 -5
- package/lib/index.ts +12 -9
- package/lib/introspection.ts +3 -3
- package/lib/lookup.ts +6 -6
- package/lib/schema-columns.ts +2 -5
- package/lib/sealed/build.ts +8 -7
- package/lib/sealed/db.ts +99 -18
- package/lib/sealed.ts +11 -9
- package/out/batched.d.ts +2 -6
- package/out/batched.d.ts.map +1 -1
- package/out/batched.js +2 -8
- package/out/batched.js.map +1 -1
- package/out/client.d.ts +2 -7
- package/out/client.d.ts.map +1 -1
- package/out/client.js +3 -6
- package/out/client.js.map +1 -1
- package/out/database-schema.d.ts +0 -4
- package/out/database-schema.d.ts.map +1 -1
- package/out/database-schema.js +2 -7
- package/out/database-schema.js.map +1 -1
- package/out/dialect/config.d.ts +1 -6
- package/out/dialect/config.d.ts.map +1 -1
- package/out/dialect/config.js +2 -5
- package/out/dialect/config.js.map +1 -1
- package/out/dialect.d.ts +0 -5
- package/out/dialect.d.ts.map +1 -1
- package/out/dialect.js +2 -5
- package/out/dialect.js.map +1 -1
- package/out/driver.d.ts +0 -5
- package/out/driver.d.ts.map +1 -1
- package/out/driver.js +2 -5
- package/out/driver.js.map +1 -1
- package/out/index.d.ts +9 -9
- package/out/index.d.ts.map +1 -1
- package/out/index.js +11 -9
- package/out/index.js.map +1 -1
- package/out/introspection.d.ts +0 -3
- package/out/introspection.d.ts.map +1 -1
- package/out/introspection.js +2 -11
- package/out/introspection.js.map +1 -1
- package/out/lookup.d.ts +3 -6
- package/out/lookup.d.ts.map +1 -1
- package/out/lookup.js +2 -9
- package/out/lookup.js.map +1 -1
- package/out/schema-columns.d.ts +0 -5
- package/out/schema-columns.d.ts.map +1 -1
- package/out/schema-columns.js +2 -5
- package/out/schema-columns.js.map +1 -1
- package/out/sealed/build.d.ts +1 -6
- package/out/sealed/build.d.ts.map +1 -1
- package/out/sealed/build.js +6 -6
- package/out/sealed/build.js.map +1 -1
- package/out/sealed/db.d.ts +45 -15
- package/out/sealed/db.d.ts.map +1 -1
- package/out/sealed/db.js +50 -22
- package/out/sealed/db.js.map +1 -1
- package/out/sealed.d.ts +8 -9
- package/out/sealed.d.ts.map +1 -1
- package/out/sealed.js +2 -13
- package/out/sealed.js.map +1 -1
- package/out/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +2 -2
package/out/driver.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../lib/driver.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../lib/driver.ts"],"names":[],"mappings":"AAKA,OAAO,EAGN,KAAK,kBAAkB,EACvB,KAAK,MAAM,EAEX,KAAK,aAAa,EAIlB,MAAM,QAAQ,CAAA;AAEf,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AA0B1D,qBAAa,YAAa,YAAW,MAAM;;IAO1C,YAAY,MAAM,EAAE,mBAAmB,EAEtC;IAEK,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAS1B;IAEK,iBAAiB,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAOrD;IAEK,gBAAgB,CAAC,UAAU,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAEpE;IAEK,iBAAiB,CAAC,UAAU,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAErE;IAEK,mBAAmB,CAAC,UAAU,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAEvE;IAEK,SAAS,CACd,UAAU,EAAE,kBAAkB,EAC9B,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,aAAa,CAAC,cAAc,CAAC,GACzC,OAAO,CAAC,IAAI,CAAC,CAEf;IAEK,mBAAmB,CACxB,UAAU,EAAE,kBAAkB,EAC9B,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,aAAa,CAAC,cAAc,CAAC,GACzC,OAAO,CAAC,IAAI,CAAC,CAEf;IAEK,gBAAgB,CACrB,UAAU,EAAE,kBAAkB,EAC9B,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,aAAa,CAAC,cAAc,CAAC,GACzC,OAAO,CAAC,IAAI,CAAC,CAEf;IAEK,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAEvC;IAEK,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAE7B;CACD"}
|
package/out/driver.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*/
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
6
3
|
import { CompiledQuery, createQueryId, IdentifierNode, RawNode, SelectQueryNode, } from "kysely";
|
|
7
4
|
class ConnectionMutex {
|
|
8
5
|
#promise;
|
package/out/driver.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver.js","sourceRoot":"","sources":["../lib/driver.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"driver.js","sourceRoot":"","sources":["../lib/driver.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAIlE,OAAO,EACN,aAAa,EACb,aAAa,EAGb,cAAc,EAGd,OAAO,EACP,eAAe,GACf,MAAM,QAAQ,CAAA;AAIf,MAAM,eAAe;IACpB,QAAQ,CAAgB;IACxB,QAAQ,CAAa;IAErB,KAAK,CAAC,IAAI;QACT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AAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAA;QAExD,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;YAChC,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAA;QAC3E,CAAC;QAED,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAwB,CAAA;QAEzD,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YACxB,MAAM;gBACL,IAAI,EAAE,CAAC,GAAG,CAAC;aACX,CAAA;QACF,CAAC;IACF,CAAC;CACD;AAED,SAAS,qBAAqB,CAAC,OAAe,EAAE,aAAqB;IACpE,OAAO,OAAO,CAAC,kBAAkB,CAAC;QACjC,OAAO,CAAC,aAAa,CAAC,GAAG,OAAO,GAAG,CAAC;QACpC,cAAc,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,uCAAuC;KAC7E,CAAC,CAAA;AACH,CAAC"}
|
package/out/index.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
2
|
* The one way a Mailwoman SQLite connection comes into being.
|
|
7
3
|
*
|
|
8
|
-
* `DatabaseClient` opens the file; `openBuiltClient` opens a built artifact with the seal check.
|
|
9
|
-
*
|
|
10
|
-
*
|
|
4
|
+
* `DatabaseClient` opens the file; `openBuiltClient` opens a built artifact with the seal check.
|
|
5
|
+
* A caller specifies which file and schema.
|
|
6
|
+
*
|
|
7
|
+
* It never constructs the connection, so one database has one schema, one owner
|
|
8
|
+
* and a lifetime `using` can end.
|
|
9
|
+
* `new DatabaseSync` appears once in this package and nowhere else in the repository.
|
|
11
10
|
*
|
|
12
|
-
* It lives outside `@mailwoman/core` because it needs none of core's 11 MB of parser reference data.
|
|
13
|
-
* dependency set is `kysely`.
|
|
11
|
+
* It lives outside `@mailwoman/core` because it needs none of core's 11 MB of parser reference data.
|
|
12
|
+
* Its whole dependency set is `kysely`.
|
|
13
|
+
* That's what lets the leaf lookups use it.
|
|
14
14
|
*/
|
|
15
15
|
export * from "#batched";
|
|
16
16
|
export * from "#client";
|
package/out/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;GAaG;AAEH,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,kBAAkB,CAAA;AAChC,cAAc,UAAU,CAAA;AACxB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA;AACvB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,SAAS,CAAA;AACvB,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA"}
|
package/out/index.js
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
1
3
|
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
4
|
* The one way a Mailwoman SQLite connection comes into being.
|
|
7
5
|
*
|
|
8
|
-
* `DatabaseClient` opens the file; `openBuiltClient` opens a built artifact with the seal check.
|
|
9
|
-
*
|
|
10
|
-
*
|
|
6
|
+
* `DatabaseClient` opens the file; `openBuiltClient` opens a built artifact with the seal check.
|
|
7
|
+
* A caller specifies which file and schema.
|
|
8
|
+
*
|
|
9
|
+
* It never constructs the connection, so one database has one schema, one owner
|
|
10
|
+
* and a lifetime `using` can end.
|
|
11
|
+
* `new DatabaseSync` appears once in this package and nowhere else in the repository.
|
|
11
12
|
*
|
|
12
|
-
* It lives outside `@mailwoman/core` because it needs none of core's 11 MB of parser reference data.
|
|
13
|
-
* dependency set is `kysely`.
|
|
13
|
+
* It lives outside `@mailwoman/core` because it needs none of core's 11 MB of parser reference data.
|
|
14
|
+
* Its whole dependency set is `kysely`.
|
|
15
|
+
* That's what lets the leaf lookups use it.
|
|
14
16
|
*/
|
|
15
17
|
export * from "#batched";
|
|
16
18
|
export * from "#client";
|
package/out/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,kBAAkB,CAAA;AAChC,cAAc,UAAU,CAAA;AACxB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA;AACvB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,SAAS,CAAA;AACvB,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAElE;;;;;;;;;;;;;GAaG;AAEH,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,kBAAkB,CAAA;AAChC,cAAc,UAAU,CAAA;AACxB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA;AACvB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,SAAS,CAAA;AACvB,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA"}
|
package/out/introspection.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"introspection.d.ts","sourceRoot":"","sources":["../lib/introspection.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"introspection.d.ts","sourceRoot":"","sources":["../lib/introspection.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,EAAE,EAAE,cAAc,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAE7E;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,EAAE,EAAE,EAAE,EAAE,cAAc,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAI3E;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,EAAE,EAAE,cAAc,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAE7E;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,EAAE,EAAE,cAAc,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAM/D;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,EAAE,EAAE,EAAE,EAAE,cAAc,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAI5F"}
|
package/out/introspection.js
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
* @file Questions asked of `sqlite_master`.
|
|
6
|
-
*
|
|
7
|
-
* its own subpath on purpose — do not fold this into the package barrel. `@mailwoman/sqlite`'s root export
|
|
8
|
-
* reaches `node:sqlite`, and the docs demo bundles this package for the browser. importing the barrel to
|
|
9
|
-
* ask whether a table exists dragged the builtin into that graph. The split is what keeps these three
|
|
10
|
-
* pure-SQL questions reachable from a bundled consumer.
|
|
11
|
-
*/
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
12
3
|
/**
|
|
13
4
|
* Whether a table exists with the value in `name`.
|
|
14
5
|
*
|
package/out/introspection.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"introspection.js","sourceRoot":"","sources":["../lib/introspection.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"introspection.js","sourceRoot":"","sources":["../lib/introspection.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAalE;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAK,EAAsB,EAAE,IAAY;IACnE,OAAO,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,+DAA+D,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAA;AACtG,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAK,EAAsB,EAAE,KAAa;IAClE,MAAM,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,6BAA6B,KAAK,EAAE,CAAC,CAAC,GAAG,EAAgC,CAAA;IAEhG,OAAO,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,CAAA;AAC3B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAK,EAAsB,EAAE,IAAY;IACnE,OAAO,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,+DAA+D,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAA;AACtG,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAK,EAAsB;IACpD,MAAM,IAAI,GAAG,EAAE,CAAC,OAAO,CAAC,mEAAmE,CAAC,CAAC,GAAG,EAE9F,CAAA;IAEF,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;AACnC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAK,EAAsB,EAAE,KAAa,EAAE,MAAc;IAClF,MAAM,IAAI,GAAG,EAAE,CAAC,OAAO,CAAC,qBAAqB,KAAK,GAAG,CAAC,CAAC,GAAG,EAA6B,CAAA;IAEvF,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,MAAM,CAAC,CAAA;AAC/C,CAAC"}
|
package/out/lookup.d.ts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
2
|
* The shared shape of a reader over one SQLite artifact.
|
|
7
|
-
*
|
|
8
|
-
*
|
|
3
|
+
*
|
|
4
|
+
* A lookup either opens the file it is given or adopts a connection already held
|
|
5
|
+
* by the caller. and it closes on disposal only what it opened.
|
|
9
6
|
*/
|
|
10
7
|
import type { PathBuilderLike } from "path-ts";
|
|
11
8
|
import { DatabaseClient, type DatabaseSyncOptions } from "#client";
|
package/out/lookup.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lookup.d.ts","sourceRoot":"","sources":["../lib/lookup.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lookup.d.ts","sourceRoot":"","sources":["../lib/lookup.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAElE;;;GAGG;AACH,MAAM,WAAW,mBAAmB,CAAC,EAAE;IACtC;;;OAGG;IACH,YAAY,CAAC,EAAE,eAAe,CAAA;IAC9B;;;OAGG;IACH,QAAQ,CAAC,EAAE,cAAc,CAAC,EAAE,CAAC,CAAA;CAC7B;AAED;;;;;;;GAOG;AACH,8BAAsB,YAAY,CAAC,EAAE,CAAE,YAAW,UAAU;;IAS3D,SAAS,aAAa,MAAM,EAAE,mBAAmB,CAAC,EAAE,CAAC,EAAE,WAAW,GAAE,mBAAwC,EAY3G;IAED;;OAEG;IACH,SAAS,KAAK,QAAQ,IAAI,cAAc,CAAC,EAAE,CAAC,CAE3C;IAED;;;OAGG;IACH,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI,CAEvB;CACD"}
|
package/out/lookup.js
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* The shared shape of a reader over one SQLite artifact.
|
|
7
|
-
* A lookup either opens the file it is given or adopts a connection already held by the caller.
|
|
8
|
-
* and it closes on disposal only what it opened.
|
|
9
|
-
*/
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
10
3
|
import { DatabaseClient } from "#client";
|
|
11
4
|
/**
|
|
12
5
|
* A reader over one SQLite database that owns only the connection it opened.
|
package/out/lookup.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lookup.js","sourceRoot":"","sources":["../lib/lookup.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"lookup.js","sourceRoot":"","sources":["../lib/lookup.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAWlE,OAAO,EAAE,cAAc,EAA4B,MAAM,SAAS,CAAA;AAmBlE;;;;;;;GAOG;AACH,MAAM,OAAgB,YAAY;IACxB,SAAS,CAAoB;IACtC;;;;OAIG;IACM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAA;IAEvC,YAAsB,MAA+B,EAAE,WAAW,GAAwB,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC3G,IAAI,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;YAC5C,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,MAAM,CAAC,IAAI,0DAA0D,CAAC,CAAA;QAC9F,CAAC;QAED,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YACrB,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAA;QACjC,CAAC;aAAM,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;YAChC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,cAAc,CAAK,MAAM,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC,CAAA;QAC3F,CAAC;aAAM,CAAC;YACP,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,MAAM,CAAC,IAAI,uDAAuD,CAAC,CAAA;QAC3F,CAAC;IACF,CAAC;IAED;;OAEG;IACH,IAAc,QAAQ;QACrB,OAAO,IAAI,CAAC,SAAS,CAAA;IACtB,CAAC;IAED;;;OAGG;IACH,CAAC,MAAM,CAAC,OAAO,CAAC;QACf,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAA;IAC9B,CAAC;CACD"}
|
package/out/schema-columns.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-columns.d.ts","sourceRoot":"","sources":["../lib/schema-columns.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema-columns.d.ts","sourceRoot":"","sources":["../lib/schema-columns.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAExD;;;;;GAKG;AACH,MAAM,MAAM,YAAY,CAAC,EAAE,IAAI,IAAI,CAAC,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;IACH,WAAW,EAAE,MAAM,CAAA;CACnB"}
|
package/out/schema-columns.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*/
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
6
3
|
/**
|
|
7
4
|
* The precomputed bounding box every polygon table includes — truth tables
|
|
8
5
|
* and extent tables alike — in the order the sealed artifacts store it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-columns.js","sourceRoot":"","sources":["../lib/schema-columns.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"schema-columns.js","sourceRoot":"","sources":["../lib/schema-columns.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAYlE;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CACpC,OAAkC;IAElC,OAAO,OAAO;SACZ,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;SAC1D,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;SAC1D,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;SAC1D,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAA;AAC7D,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAC7B,OAAkC;IAElC,OAAO,OAAO,CAAC,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAA;AACxE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CACrC,OAAkC;IAElC,OAAO,cAAc,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAAA;AACtD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CAClC,OAAkC,EAClC,UAA4B;IAE5B,IAAI,KAAK,GAA6D,OAAO;SAC3E,SAAS,CAAC,SAAS,EAAE,SAAS,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;SAC7D,SAAS,CAAC,YAAY,EAAE,SAAS,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAA;IAElE,KAAK,MAAM,SAAS,IAAI,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;QACpF,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAA;IACzE,CAAC;IAED,OAAO,KAAK,CAAC,SAAS,CAAC,aAAa,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAA;AAC5E,CAAC"}
|
package/out/sealed/build.d.ts
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*/
|
|
6
1
|
import type { PathBuilderLike } from "path-ts";
|
|
7
2
|
import { DatabaseClient } from "#client";
|
|
8
3
|
export interface BuildSealedArtifactOptions<DB, Streamed, Result> {
|
|
@@ -22,7 +17,7 @@ export interface BuildSealedArtifactOptions<DB, Streamed, Result> {
|
|
|
22
17
|
ingest: (database: DatabaseClient<DB>) => Promise<Streamed | null>;
|
|
23
18
|
/**
|
|
24
19
|
* The bounded child-process ingest, run while the parent holds no handle: each child opens the
|
|
25
|
-
* temp file and appends one chunk at a time, so there
|
|
20
|
+
* temp file and appends one chunk at a time, so there's exactly one writer at every instant.
|
|
26
21
|
*/
|
|
27
22
|
batched?: (tmpPath: string) => Promise<Streamed>;
|
|
28
23
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../lib/sealed/build.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../lib/sealed/build.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAGxC,MAAM,WAAW,0BAA0B,CAAC,EAAE,EAAE,QAAQ,EAAE,MAAM;IAC/D;;OAEG;IACH,GAAG,EAAE,eAAe,CAAA;IACpB;;OAEG;IACH,YAAY,EAAE,CAAC,QAAQ,EAAE,cAAc,CAAC,EAAE,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC7D;;;;OAIG;IACH,MAAM,EAAE,CAAC,QAAQ,EAAE,cAAc,CAAC,EAAE,CAAC,KAAK,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAA;IAClE;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;IAChD;;;;;OAKG;IACH,MAAM,EAAE,CAAC,QAAQ,EAAE,cAAc,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;CAC7E;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,EAAE,EAAE,QAAQ,EAAE,MAAM,EAC7D,OAAO,EAAE,0BAA0B,CAAC,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,GACvD,OAAO,CAAC,MAAM,CAAC,CA+DjB"}
|
package/out/sealed/build.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*/
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
6
3
|
import { removePathIfPresent } from "@mailwoman/core/fs/writers";
|
|
7
4
|
import { DatabaseClient } from "#client";
|
|
8
|
-
import { sealDatabase, swapDatabaseIntoPlace } from "#sealed/db";
|
|
5
|
+
import { recoverInterruptedBuilds, sealDatabase, swapDatabaseIntoPlace } from "#sealed/db";
|
|
9
6
|
/**
|
|
10
7
|
* Run one sealed-artifact build.
|
|
11
8
|
*/
|
|
12
9
|
export async function buildSealedArtifact(options) {
|
|
13
10
|
const tmpPath = `${options.out}.tmp-${process.pid}`;
|
|
11
|
+
// A killed earlier build's temp file is removed before this one writes its own, and a version
|
|
12
|
+
// it set aside moves back into an empty slot so readers keep a database while this build runs.
|
|
13
|
+
await recoverInterruptedBuilds(options.out);
|
|
14
14
|
let streamed;
|
|
15
15
|
{
|
|
16
16
|
using kdb = new DatabaseClient(tmpPath);
|
package/out/sealed/build.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../lib/sealed/build.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../lib/sealed/build.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAElE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AAGhE,OAAO,EAAE,cAAc,EAA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;YAElC,MAAM,KAAK,CAAA;QACZ,CAAC;IACF,CAAC;IAED,MAAM,GAAG,GAAG,IAAI,cAAc,CAAK,OAAO,CAAC,CAAA;IAE3C,IAAI,CAAC;QACJ,GAAG,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAA;QACrC,GAAG,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAA;QAEpC,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,QAAoB,CAAC,CAAA;QAE9D,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QAElB,MAAM,GAAG,CAAC,OAAO,EAAE,CAAA;QAEnB,MAAM,YAAY,CAAC,OAAO,CAAC,CAAA;QAC3B,MAAM,qBAAqB,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAA;QAEjD,OAAO,MAAM,CAAA;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,MAAM,GAAG,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAA;QAC1C,MAAM,mBAAmB,CAAC,OAAO,CAAC,CAAA;QAElC,MAAM,KAAK,CAAA;IACZ,CAAC;AACF,CAAC"}
|
package/out/sealed/db.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
2
|
+
* The sealed-artifact invariant: every SQLite DB a build produces is a read-only asset.
|
|
3
|
+
*
|
|
4
|
+
* `sealDatabase` is the last step of every builder — checkpoint, freeze the journal, chmod 0444.
|
|
5
|
+
* `openBuiltClient` (`@mailwoman/sqlite/sealed`) is how anything opens a data
|
|
6
|
+
* artifact. a write-mode open of a sealed file throws a descriptive error pointing
|
|
7
|
+
* at the rebuild command instead of a cryptic SQLITE_READONLY.
|
|
8
|
+
*
|
|
9
|
+
* A caller can restore write permission only with manual `chmod u+w`;
|
|
10
|
+
* the program never changes permissions.
|
|
11
11
|
* Rebuild the artifact to make changes.
|
|
12
12
|
*
|
|
13
|
-
* `swapDatabaseIntoPlace` is the atomic publish step agents.md
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* shared function.
|
|
13
|
+
* `swapDatabaseIntoPlace` is the atomic publish step agents.md specifies in prose
|
|
14
|
+
* ("build it successfully. Move the previous version to a temp directory. Move the new version into place.").
|
|
15
|
+
* It lives here because this module already owns the built-artifact lifecycle.
|
|
16
|
+
*
|
|
17
|
+
* A rule stated in project prose and implemented by several builders belongs in a shared function.
|
|
18
18
|
*/
|
|
19
19
|
import type { DatabaseSync } from "node:sqlite";
|
|
20
20
|
import { type PathBuilderLike } from "path-ts";
|
|
@@ -43,7 +43,7 @@ export declare function isSealed(path: PathBuilderLike): Promise<boolean>;
|
|
|
43
43
|
*/
|
|
44
44
|
export declare function sealDatabase(path: PathBuilderLike): Promise<void>;
|
|
45
45
|
/**
|
|
46
|
-
* Verify a freshly-built database
|
|
46
|
+
* Verify a freshly-built database isn't corrupt, immediately before it is sealed and published.
|
|
47
47
|
*
|
|
48
48
|
* Belongs beside {@link sealDatabase} for the same reason `swapDatabaseIntoPlace` does.
|
|
49
49
|
* The check is part of the built-artifact lifecycle.
|
|
@@ -86,5 +86,35 @@ export declare function assertUnsealedForWrite(path: PathBuilderLike): Promise<v
|
|
|
86
86
|
* Mode 0444 still permits a rename.
|
|
87
87
|
*/
|
|
88
88
|
export declare function swapDatabaseIntoPlace(tmpPath: PathBuilderLike, finalPath: PathBuilderLike): Promise<void>;
|
|
89
|
+
/**
|
|
90
|
+
* The suffixes a writer gives the two siblings of a published path, each followed by `-<pid>`.
|
|
91
|
+
*/
|
|
92
|
+
export interface BuildSiblingSuffixes {
|
|
93
|
+
/**
|
|
94
|
+
* The sibling a writer fills before the swap, such as `tmp` or `staging`.
|
|
95
|
+
*/
|
|
96
|
+
building: string;
|
|
97
|
+
/**
|
|
98
|
+
* The sibling the swap moves the published version to, such as `old` or `replaced`.
|
|
99
|
+
*/
|
|
100
|
+
setAside: string;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Restores or removes what an interrupted write of `finalPath` left beside it.
|
|
104
|
+
*
|
|
105
|
+
* A sealed build writes `<final>.tmp-<pid>` and, during its swap, moves the
|
|
106
|
+
* published file to `<final>.old-<pid>`.
|
|
107
|
+
* A process killed in between leaves those files on disk under a pid no later build shares.
|
|
108
|
+
*
|
|
109
|
+
* Another writer that follows the same pattern under other names passes its `suffixes`.
|
|
110
|
+
* A sibling may be a file or a directory, and a file's `-wal` and `-shm` sidecars count with it.
|
|
111
|
+
*
|
|
112
|
+
* When the published slot is empty, the newest set-aside sibling of an exited process
|
|
113
|
+
* is the last published version, and it moves back into the slot.
|
|
114
|
+
* Every other sibling of an exited process is removed.
|
|
115
|
+
*
|
|
116
|
+
* A sibling whose process still runs belongs to a write in progress and stays.
|
|
117
|
+
*/
|
|
118
|
+
export declare function recoverInterruptedBuilds(finalPath: PathBuilderLike, suffixes?: BuildSiblingSuffixes): Promise<void>;
|
|
89
119
|
export {};
|
|
90
120
|
//# sourceMappingURL=db.d.ts.map
|
package/out/sealed/db.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../../lib/sealed/db.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../../lib/sealed/db.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAM/C,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AAEjE;;;;GAIG;AACH,KAAK,cAAc,GAAG,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,CAAA;AAenD;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;IAC7C,YAAY,IAAI,EAAE,eAAe,EAOhC;CACD;AAED;;GAEG;AACH,wBAAsB,QAAQ,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,CAEtE;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CA8BvE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,cAAc,EAAE,QAAQ,EAAE,eAAe,GAAG,IAAI,CAO3F;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAEjF;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CA+B/G;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;CAChB;AAID;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,wBAAwB,CAC7C,SAAS,EAAE,eAAe,EAC1B,QAAQ,GAAE,oBAA4C,GACpD,OAAO,CAAC,IAAI,CAAC,CAuCf"}
|
package/out/sealed/db.js
CHANGED
|
@@ -1,24 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
* The sealed-artifact invariant: every SQLite DB a build produces is a read-only asset. `sealDatabase`
|
|
7
|
-
* is the last step of every builder — checkpoint, freeze the journal, chmod 0444. `openBuiltClient`
|
|
8
|
-
* (`@mailwoman/sqlite/sealed`) is how anything opens a data artifact. a write-mode open of a sealed
|
|
9
|
-
* file throws a descriptive error pointing at the rebuild command instead of a cryptic SQLITE_READONLY.
|
|
10
|
-
* A caller can restore write permission only with manual `chmod u+w`; the program never changes permissions.
|
|
11
|
-
* Rebuild the artifact to make changes.
|
|
12
|
-
*
|
|
13
|
-
* `swapDatabaseIntoPlace` is the atomic publish step agents.md
|
|
14
|
-
* specifies in prose ("build it successfully. Move the previous version to a temp directory.
|
|
15
|
-
* Move the new version into place."). It lives here because this module already owns the
|
|
16
|
-
* built-artifact lifecycle. A rule stated in project prose and implemented by several builders belongs in a
|
|
17
|
-
* shared function.
|
|
18
|
-
*/
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
import { processExists } from "@mailwoman/core/fs/lock";
|
|
4
|
+
import { sortedGlob } from "@mailwoman/core/fs/readers";
|
|
19
5
|
import { pathExists, statPath } from "@mailwoman/core/fs/readers/stat";
|
|
20
6
|
import { changeMode, movePath, removePath, removePathIfPresent } from "@mailwoman/core/fs/writers";
|
|
21
|
-
import { basename } from "path-ts";
|
|
7
|
+
import { basename, dirname } from "path-ts";
|
|
22
8
|
/**
|
|
23
9
|
* `node:sqlite` via {@link process.getBuiltinModule} — invisible to bundlers.
|
|
24
10
|
*
|
|
@@ -79,7 +65,7 @@ export async function sealDatabase(path) {
|
|
|
79
65
|
await changeMode(path, 0o444);
|
|
80
66
|
}
|
|
81
67
|
/**
|
|
82
|
-
* Verify a freshly-built database
|
|
68
|
+
* Verify a freshly-built database isn't corrupt, immediately before it is sealed and published.
|
|
83
69
|
*
|
|
84
70
|
* Belongs beside {@link sealDatabase} for the same reason `swapDatabaseIntoPlace` does.
|
|
85
71
|
* The check is part of the built-artifact lifecycle.
|
|
@@ -145,8 +131,7 @@ export async function swapDatabaseIntoPlace(tmpPath, finalPath) {
|
|
|
145
131
|
}
|
|
146
132
|
catch (error) {
|
|
147
133
|
// The prior version is already aside at this point.
|
|
148
|
-
// A failed forward rename
|
|
149
|
-
// artifact sits one rename away.
|
|
134
|
+
// A failed forward rename mustn't leave the slot empty while a restorable artifact sits one rename away.
|
|
150
135
|
if ((await pathExists(aside)) && !(await pathExists(finalPathString))) {
|
|
151
136
|
await movePath(aside, finalPathString);
|
|
152
137
|
}
|
|
@@ -156,5 +141,48 @@ export async function swapDatabaseIntoPlace(tmpPath, finalPath) {
|
|
|
156
141
|
await removePathIfPresent(tmpPathString + sfx);
|
|
157
142
|
}
|
|
158
143
|
await removePathIfPresent(aside);
|
|
144
|
+
await recoverInterruptedBuilds(finalPath);
|
|
145
|
+
}
|
|
146
|
+
const SEALED_BUILD_SUFFIXES = { building: "tmp", setAside: "old" };
|
|
147
|
+
/**
|
|
148
|
+
* Restores or removes what an interrupted write of `finalPath` left beside it.
|
|
149
|
+
*
|
|
150
|
+
* A sealed build writes `<final>.tmp-<pid>` and, during its swap, moves the
|
|
151
|
+
* published file to `<final>.old-<pid>`.
|
|
152
|
+
* A process killed in between leaves those files on disk under a pid no later build shares.
|
|
153
|
+
*
|
|
154
|
+
* Another writer that follows the same pattern under other names passes its `suffixes`.
|
|
155
|
+
* A sibling may be a file or a directory, and a file's `-wal` and `-shm` sidecars count with it.
|
|
156
|
+
*
|
|
157
|
+
* When the published slot is empty, the newest set-aside sibling of an exited process
|
|
158
|
+
* is the last published version, and it moves back into the slot.
|
|
159
|
+
* Every other sibling of an exited process is removed.
|
|
160
|
+
*
|
|
161
|
+
* A sibling whose process still runs belongs to a write in progress and stays.
|
|
162
|
+
*/
|
|
163
|
+
export async function recoverInterruptedBuilds(finalPath, suffixes = SEALED_BUILD_SUFFIXES) {
|
|
164
|
+
const finalPathString = finalPath.toString();
|
|
165
|
+
const directory = dirname(finalPathString).toString();
|
|
166
|
+
if (!(await pathExists(directory)))
|
|
167
|
+
return;
|
|
168
|
+
const name = basename(finalPathString).toString();
|
|
169
|
+
const siblingPattern = new RegExp(`\\.(${RegExp.escape(suffixes.building)}|${RegExp.escape(suffixes.setAside)})-(\\d+)(-wal|-shm)?$`, "u");
|
|
170
|
+
const siblings = [
|
|
171
|
+
...(await sortedGlob(directory, `${name}.${suffixes.building}-*`, { onlyFiles: false })),
|
|
172
|
+
...(await sortedGlob(directory, `${name}.${suffixes.setAside}-*`, { onlyFiles: false })),
|
|
173
|
+
].flatMap((path) => {
|
|
174
|
+
const match = siblingPattern.exec(path);
|
|
175
|
+
return match && !processExists(Number(match[2])) ? [{ path, kind: match[1], sidecar: match[3] ?? null }] : [];
|
|
176
|
+
});
|
|
177
|
+
if (!(await pathExists(finalPathString))) {
|
|
178
|
+
const stranded = siblings.filter((sibling) => sibling.kind === suffixes.setAside && !sibling.sidecar);
|
|
179
|
+
const newest = (await Promise.all(stranded.map(async (sibling) => ({ ...sibling, mtimeMs: (await statPath(sibling.path)).mtimeMs })))).toSorted((a, b) => b.mtimeMs - a.mtimeMs)[0];
|
|
180
|
+
if (newest) {
|
|
181
|
+
await movePath(newest.path, finalPathString);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
for (const sibling of siblings) {
|
|
185
|
+
await removePathIfPresent(sibling.path);
|
|
186
|
+
}
|
|
159
187
|
}
|
|
160
188
|
//# sourceMappingURL=db.js.map
|
package/out/sealed/db.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db.js","sourceRoot":"","sources":["../../lib/sealed/db.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"db.js","sourceRoot":"","sources":["../../lib/sealed/db.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAuBlE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAA;AACtE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,mBAAmB,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,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,QAAQ,CAAC,QAAQ,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;QAErG,MAAM,MAAM,GAAG,CACd,MAAM,OAAO,CAAC,GAAG,CAChB,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,CAAC,MAAM,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAClG,CACD,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAA;QAE9C,IAAI,MAAM,EAAE,CAAC;YACZ,MAAM,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,CAAC,CAAA;QAC7C,CAAC;IACF,CAAC;IAED,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAChC,MAAM,mBAAmB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IACxC,CAAC;AACF,CAAC"}
|
package/out/sealed.d.ts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
2
|
* Open a built data artifact.
|
|
7
3
|
*
|
|
8
|
-
* This is the other half of the sealed-artifact invariant in `../utils/sealed-db.ts`:
|
|
9
|
-
* filesystem side (seal, unseal-refusal, atomic swap)
|
|
10
|
-
*
|
|
11
|
-
* `
|
|
12
|
-
*
|
|
4
|
+
* This is the other half of the sealed-artifact invariant in `../utils/sealed-db.ts`:
|
|
5
|
+
* that module owns the filesystem side (seal, unseal-refusal, atomic swap)
|
|
6
|
+
* and stays free of a static `node:sqlite` import, because it flows through the
|
|
7
|
+
* `@mailwoman/core/utils` barrel into consumers that cannot resolve one.
|
|
8
|
+
* The open lives here, where `DatabaseClient` is already imported and the cost is paid.
|
|
9
|
+
*
|
|
10
|
+
* The open is asynchronous: the write branch awaits the seal check against the
|
|
11
|
+
* filesystem before the handle is constructed.
|
|
13
12
|
*/
|
|
14
13
|
import type { PathBuilderLike } from "path-ts";
|
|
15
14
|
import { DatabaseClient } from "#client";
|
package/out/sealed.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sealed.d.ts","sourceRoot":"","sources":["../lib/sealed.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sealed.d.ts","sourceRoot":"","sources":["../lib/sealed.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACxC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAGhD;;;;;;;;;;GAUG;AACH,wBAAsB,eAAe,CAAC,EAAE,GAAG,QAAQ,EAClD,IAAI,EAAE,eAAe,EACrB,IAAI,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,GAC5B,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,CAQ7B"}
|
package/out/sealed.js
CHANGED
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* Open a built data artifact.
|
|
7
|
-
*
|
|
8
|
-
* This is the other half of the sealed-artifact invariant in `../utils/sealed-db.ts`: that module owns the
|
|
9
|
-
* filesystem side (seal, unseal-refusal, atomic swap) and stays free of a static `node:sqlite` import, because it
|
|
10
|
-
* flows through the `@mailwoman/core/utils` barrel into consumers that cannot resolve one. The open lives here, where
|
|
11
|
-
* `DatabaseClient` is already imported and the cost is paid. The open is asynchronous: the write branch awaits the
|
|
12
|
-
* seal check against the filesystem before the handle is constructed.
|
|
13
|
-
*/
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
14
3
|
import { DatabaseClient } from "#client";
|
|
15
4
|
import { assertUnsealedForWrite } from "#sealed/db";
|
|
16
5
|
/**
|
package/out/sealed.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sealed.js","sourceRoot":"","sources":["../lib/sealed.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"sealed.js","sourceRoot":"","sources":["../lib/sealed.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAiBlE,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAExC,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAA;AAEnD;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACpC,IAAqB,EACrB,IAAI,GAAwB,EAAE;IAE9B,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;QAChB,MAAM,sBAAsB,CAAC,IAAI,CAAC,CAAA;QAElC,OAAO,IAAI,cAAc,CAAK,IAAI,CAAC,CAAA;IACpC,CAAC;IAED,OAAO,IAAI,cAAc,CAAK,IAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;AACxD,CAAC"}
|