@mailwoman/sqlite 11.1.0 → 11.3.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 +2 -2
- package/lib/ingest-chunk-script.ts +87 -0
- package/lib/introspection.ts +5 -4
- package/lib/lookup.ts +2 -2
- package/lib/sealed/build.ts +5 -2
- package/lib/sealed/digest.ts +211 -0
- package/lib/sealed.ts +3 -2
- package/out/ingest-chunk-script.d.ts +58 -0
- package/out/ingest-chunk-script.d.ts.map +1 -0
- package/out/ingest-chunk-script.js +47 -0
- package/out/ingest-chunk-script.js.map +1 -0
- package/out/introspection.d.ts +5 -4
- package/out/introspection.d.ts.map +1 -1
- package/out/introspection.js.map +1 -1
- package/out/lookup.d.ts +2 -2
- package/out/sealed/build.d.ts +1 -1
- package/out/sealed/build.d.ts.map +1 -1
- package/out/sealed/build.js +4 -1
- package/out/sealed/build.js.map +1 -1
- package/out/sealed/digest.d.ts +53 -0
- package/out/sealed/digest.d.ts.map +1 -0
- package/out/sealed/digest.js +122 -0
- package/out/sealed/digest.js.map +1 -0
- package/out/sealed.d.ts +3 -2
- package/out/sealed.d.ts.map +1 -1
- package/out/sealed.js +3 -2
- package/out/sealed.js.map +1 -1
- package/out/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @mailwoman/sqlite
|
|
2
2
|
|
|
3
|
-
This package provides typed Kysely connections backed by Node.js SQLite
|
|
3
|
+
This package provides typed Kysely connections backed by Node.js SQLite. It also provides helpers for building and opening read-only database artifacts.
|
|
4
4
|
|
|
5
5
|
Public library. Install with `npm install @mailwoman/sqlite`.
|
|
6
6
|
|
|
@@ -29,7 +29,7 @@ console.log(place?.name) // "Paris"
|
|
|
29
29
|
|
|
30
30
|
`DatabaseClient` extends Kysely and owns one SQLite connection. Pass a file path
|
|
31
31
|
to its constructor for a persistent database. `DatabaseClient.temp()` creates an
|
|
32
|
-
in-memory database. The package requires Node.js `^24.22.
|
|
32
|
+
in-memory database. The package requires Node.js `^24.22.3 || >=26.13.1`.
|
|
33
33
|
|
|
34
34
|
## Open a built artifact
|
|
35
35
|
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Shared setup for each layer's `scripts/ingest-chunk.ts`.
|
|
6
|
+
*
|
|
7
|
+
* Each chunk runs in a new process because JavaScript cannot reset h3's WebAssembly heap.
|
|
8
|
+
* This helper parses shared flags, opens the database created by the parent,
|
|
9
|
+
* runs the chunk and prints its result as one JSON line.
|
|
10
|
+
*
|
|
11
|
+
* Standard output contains only the result.
|
|
12
|
+
* Progress goes to standard error.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { parseArguments, requiredArgument, type ParseArgsConfig } from "@mailwoman/core/scripting/arguments"
|
|
16
|
+
import { stringifyJSON } from "@mailwoman/core/values/json"
|
|
17
|
+
|
|
18
|
+
import { DatabaseClient } from "#client"
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Flags shared by all ingest-chunk scripts.
|
|
22
|
+
*
|
|
23
|
+
* Each script includes these in its options so this helper can read them
|
|
24
|
+
* alongside the script's typed values.
|
|
25
|
+
*/
|
|
26
|
+
export const INGEST_CHUNK_FLAGS = {
|
|
27
|
+
database: { type: "string" },
|
|
28
|
+
"index-resolution": { type: "string" },
|
|
29
|
+
"coverage-resolution": { type: "string" },
|
|
30
|
+
} as const satisfies ParseArgsConfig["options"]
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Shared settings passed to a chunk.
|
|
34
|
+
*/
|
|
35
|
+
export interface IngestChunkScriptContext {
|
|
36
|
+
indexResolution: number
|
|
37
|
+
coverageResolution: number
|
|
38
|
+
/**
|
|
39
|
+
* Writes progress to stderr with the shared chunk prefix.
|
|
40
|
+
*/
|
|
41
|
+
onProgress: (message: string) => void
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Parse flags and open the parent's database.
|
|
46
|
+
* Then run one chunk and print its JSON result.
|
|
47
|
+
*/
|
|
48
|
+
export async function runIngestChunkScript<
|
|
49
|
+
DB,
|
|
50
|
+
const Options extends NonNullable<ParseArgsConfig["options"]> & typeof INGEST_CHUNK_FLAGS,
|
|
51
|
+
>(config: {
|
|
52
|
+
/**
|
|
53
|
+
* Script name used in error messages, e.g. `flood ingest-chunk`.
|
|
54
|
+
*/
|
|
55
|
+
context: string
|
|
56
|
+
/**
|
|
57
|
+
* All script flags, including {@link INGEST_CHUNK_FLAGS}.
|
|
58
|
+
*/
|
|
59
|
+
options: Options
|
|
60
|
+
run: (
|
|
61
|
+
database: DatabaseClient<DB>,
|
|
62
|
+
values: ReturnType<typeof parseArguments<{ options: Options }>>["values"],
|
|
63
|
+
chunk: IngestChunkScriptContext
|
|
64
|
+
) => Promise<unknown>
|
|
65
|
+
}): Promise<void> {
|
|
66
|
+
const { values } = parseArguments({ options: config.options })
|
|
67
|
+
|
|
68
|
+
// Parse shared flags separately because the generic values above are not concrete inside this function.
|
|
69
|
+
// Narrow the lenient parse's values to strings.
|
|
70
|
+
const { values: shared } = parseArguments({ options: INGEST_CHUNK_FLAGS, strict: false })
|
|
71
|
+
|
|
72
|
+
const sharedFlag = (name: keyof typeof INGEST_CHUNK_FLAGS): string =>
|
|
73
|
+
requiredArgument(config.context, name, typeof shared[name] === "string" ? shared[name] : null)
|
|
74
|
+
|
|
75
|
+
using database = new DatabaseClient<DB>(sharedFlag("database"))
|
|
76
|
+
|
|
77
|
+
database.exec("PRAGMA journal_mode = OFF")
|
|
78
|
+
database.exec("PRAGMA synchronous = OFF")
|
|
79
|
+
|
|
80
|
+
const result = await config.run(database, values, {
|
|
81
|
+
indexResolution: Number(sharedFlag("index-resolution")),
|
|
82
|
+
coverageResolution: Number(sharedFlag("coverage-resolution")),
|
|
83
|
+
onProgress: (message) => console.error(` [chunk] ${message}`),
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
console.log(stringifyJSON(result))
|
|
87
|
+
}
|
package/lib/introspection.ts
CHANGED
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* @file Questions asked of `sqlite_master`.
|
|
6
6
|
*
|
|
7
|
-
* its own subpath on purpose
|
|
8
|
-
* reaches `node:sqlite`, and the docs demo bundles this package for
|
|
9
|
-
*
|
|
10
|
-
* pure-SQL questions reachable from
|
|
7
|
+
* This module has its own subpath on purpose. Do not fold it into the package barrel. The
|
|
8
|
+
* `@mailwoman/sqlite` root export reaches `node:sqlite`, and the docs demo bundles this package for
|
|
9
|
+
* the browser. A consumer that imports the barrel to ask whether a table exists would pull the
|
|
10
|
+
* builtin into that graph. The separate subpath keeps these three pure-SQL questions reachable from
|
|
11
|
+
* a bundled consumer.
|
|
11
12
|
*/
|
|
12
13
|
|
|
13
14
|
import type { DatabaseClient } from "#client"
|
package/lib/lookup.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* The shared shape of a reader over one SQLite artifact.
|
|
6
6
|
*
|
|
7
|
-
* A lookup either opens the file it is given or adopts a connection already held
|
|
8
|
-
*
|
|
7
|
+
* A lookup either opens the file it is given or adopts a connection already held by the caller.
|
|
8
|
+
* It closes on disposal only the connection it opened.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import type { PathBuilderLike } from "path-ts"
|
package/lib/sealed/build.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
2
|
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
3
|
|
|
4
|
-
import { removePathIfPresent } from "@mailwoman/core/fs/writers"
|
|
5
|
-
import type
|
|
4
|
+
import { makeDirectories, removePathIfPresent } from "@mailwoman/core/fs/writers"
|
|
5
|
+
import { dirname, type PathBuilderLike } from "path-ts"
|
|
6
6
|
|
|
7
7
|
import { DatabaseClient } from "#client"
|
|
8
8
|
import { recoverInterruptedBuilds, sealDatabase, swapDatabaseIntoPlace } from "#sealed/db"
|
|
@@ -44,6 +44,9 @@ export async function buildSealedArtifact<DB, Streamed, Result>(
|
|
|
44
44
|
): Promise<Result> {
|
|
45
45
|
const tmpPath = `${options.out}.tmp-${process.pid}`
|
|
46
46
|
|
|
47
|
+
// SQLite creates the temp file but not its directory, and a new artifact's directory may not exist yet.
|
|
48
|
+
await makeDirectories(dirname(options.out.toString()))
|
|
49
|
+
|
|
47
50
|
// A killed earlier build's temp file is removed before this one writes its own, and a version
|
|
48
51
|
// it set aside moves back into an empty slot so readers keep a database while this build runs.
|
|
49
52
|
await recoverInterruptedBuilds(options.out)
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @file A digest of a database's table contents, equal for two databases that hold the same rows.
|
|
6
|
+
*
|
|
7
|
+
* A file's md5 differs between two builds of the same rows, because page layout, free pages and a
|
|
8
|
+
* build timestamp all reach the bytes. This digest reads rows in key order instead, so a cached
|
|
9
|
+
* build and a build from scratch compare equal exactly when every table holds the same rows.
|
|
10
|
+
*
|
|
11
|
+
* `@mailwoman/core` depends on this package, so hashing comes from `node:crypto` here, the module
|
|
12
|
+
* core's hash helpers wrap.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { createHash, type Hash } from "node:crypto"
|
|
16
|
+
|
|
17
|
+
import type { DatabaseClient } from "#client"
|
|
18
|
+
import { listTables } from "#introspection"
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The columns a build writes from its own clock or checkout, left out of every digest by default.
|
|
22
|
+
*/
|
|
23
|
+
export const BUILD_STAMP_COLUMNS: Readonly<Record<string, readonly string[]>> = {
|
|
24
|
+
layer_manifest: ["created_at", "build_sha"],
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* What a content digest leaves out, and how it splits a table by country.
|
|
29
|
+
*/
|
|
30
|
+
export interface ContentDigestSpec {
|
|
31
|
+
/**
|
|
32
|
+
* Tables left out by name, beside the `sqlite_*` tables and every virtual table's shadow tables.
|
|
33
|
+
*/
|
|
34
|
+
excludeTables?: readonly string[]
|
|
35
|
+
/**
|
|
36
|
+
* Columns left out per table.
|
|
37
|
+
* Defaults to {@linkcode BUILD_STAMP_COLUMNS}.
|
|
38
|
+
*/
|
|
39
|
+
excludeColumns?: Readonly<Record<string, readonly string[]>>
|
|
40
|
+
/**
|
|
41
|
+
* A column whose value also splits each table that has it into one digest per value,
|
|
42
|
+
* so a change can be traced to the countries it touched.
|
|
43
|
+
*/
|
|
44
|
+
countryColumn?: string
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* One table's digest.
|
|
49
|
+
*/
|
|
50
|
+
export interface TableContentDigest {
|
|
51
|
+
rows: number
|
|
52
|
+
digest: string
|
|
53
|
+
/**
|
|
54
|
+
* One digest per value of the spec's country column, when the table has that column.
|
|
55
|
+
*/
|
|
56
|
+
byCountry?: Record<string, string>
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* A database's content digest: one digest per table and a root digest over them all.
|
|
61
|
+
*/
|
|
62
|
+
export interface DatabaseContentDigest {
|
|
63
|
+
root: string
|
|
64
|
+
tables: Record<string, TableContentDigest>
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
interface ColumnInfo {
|
|
68
|
+
name: string
|
|
69
|
+
pk: number
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Separates the fields of one row in the hash input.
|
|
74
|
+
*/
|
|
75
|
+
const FIELD_SEPARATOR = "\u0000"
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Ends one row in the hash input.
|
|
79
|
+
*/
|
|
80
|
+
const ROW_SEPARATOR = "\u0001"
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* The digest of every table's rows, read in primary-key order, or in the order of all columns
|
|
84
|
+
* for a table without a primary key, so insertion order and page layout leave it unchanged.
|
|
85
|
+
*
|
|
86
|
+
* A virtual table is read through its own rows, in rowid order, and its shadow
|
|
87
|
+
* tables (`<name>_data`, `<name>_node` and the rest) are left out, because they
|
|
88
|
+
* store an index layout that depends on insertion order.
|
|
89
|
+
* Each value is tagged with its storage type, so the integer `1` and the real `1.0` digest differently.
|
|
90
|
+
*/
|
|
91
|
+
export function databaseContentDigest<DB>(db: DatabaseClient<DB>, spec: ContentDigestSpec = {}): DatabaseContentDigest {
|
|
92
|
+
const excludeColumns = spec.excludeColumns ?? BUILD_STAMP_COLUMNS
|
|
93
|
+
const excludeTables = new Set(spec.excludeTables)
|
|
94
|
+
|
|
95
|
+
const virtualTables = (
|
|
96
|
+
db
|
|
97
|
+
.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND sql LIKE 'CREATE VIRTUAL TABLE%'")
|
|
98
|
+
.all() as Array<{
|
|
99
|
+
name: string
|
|
100
|
+
}>
|
|
101
|
+
).map((row) => row.name)
|
|
102
|
+
|
|
103
|
+
const isShadow = (table: string) => virtualTables.some((name) => table.startsWith(`${name}_`))
|
|
104
|
+
const tables: Record<string, TableContentDigest> = {}
|
|
105
|
+
|
|
106
|
+
for (const table of listTables(db)) {
|
|
107
|
+
if (table.startsWith("sqlite_") || excludeTables.has(table) || isShadow(table)) continue
|
|
108
|
+
|
|
109
|
+
tables[table] = digestTable(db, table, {
|
|
110
|
+
virtual: virtualTables.includes(table),
|
|
111
|
+
excluded: new Set(excludeColumns[table]),
|
|
112
|
+
countryColumn: spec.countryColumn,
|
|
113
|
+
})
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const root = createHash("sha256")
|
|
117
|
+
|
|
118
|
+
for (const [table, { digest }] of Object.entries(tables)) {
|
|
119
|
+
root.update(`${table}${FIELD_SEPARATOR}${digest}${ROW_SEPARATOR}`)
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return { root: root.digest("hex"), tables }
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* The digest of one table, with its per-country split.
|
|
127
|
+
*/
|
|
128
|
+
function digestTable<DB>(
|
|
129
|
+
db: DatabaseClient<DB>,
|
|
130
|
+
table: string,
|
|
131
|
+
options: { virtual: boolean; excluded: ReadonlySet<string>; countryColumn: string | undefined }
|
|
132
|
+
): TableContentDigest {
|
|
133
|
+
const columnInfo: ColumnInfo[] = db
|
|
134
|
+
.prepare(`PRAGMA table_info("${table}")`)
|
|
135
|
+
.all()
|
|
136
|
+
.map((row) => ({ name: String(row["name"]), pk: Number(row["pk"]) }))
|
|
137
|
+
|
|
138
|
+
const columns = columnInfo.map((column) => column.name).filter((name) => !options.excluded.has(name))
|
|
139
|
+
|
|
140
|
+
const keyColumns = columnInfo
|
|
141
|
+
.filter((column) => column.pk > 0)
|
|
142
|
+
.toSorted((a, b) => a.pk - b.pk)
|
|
143
|
+
.map((column) => column.name)
|
|
144
|
+
|
|
145
|
+
const quoted = (name: string) => `"${name.replaceAll('"', '""')}"`
|
|
146
|
+
|
|
147
|
+
const selected = (options.virtual ? ["rowid", ...columns] : columns).flatMap((name) => [
|
|
148
|
+
`typeof(${quoted(name)})`,
|
|
149
|
+
quoted(name),
|
|
150
|
+
])
|
|
151
|
+
|
|
152
|
+
const order = options.virtual ? ["rowid"] : keyColumns.length ? keyColumns : columns
|
|
153
|
+
const countryIndex = options.countryColumn ? columns.indexOf(options.countryColumn) : -1
|
|
154
|
+
const offset = options.virtual ? 1 : 0
|
|
155
|
+
|
|
156
|
+
const statement = db.prepare(
|
|
157
|
+
`SELECT ${selected.join(", ")} FROM ${quoted(table)} ORDER BY ${order.map(quoted).join(", ")}`
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
// A 64-bit id past 2^53 loses precision as a JavaScript number.
|
|
161
|
+
statement.setReadBigInts(true)
|
|
162
|
+
statement.setReturnArrays(true)
|
|
163
|
+
|
|
164
|
+
const hash = createHash("sha256")
|
|
165
|
+
const byCountry = new Map<string, Hash>()
|
|
166
|
+
let rows = 0
|
|
167
|
+
|
|
168
|
+
for (const row of statement.iterate() as Iterable<unknown[]>) {
|
|
169
|
+
const encoded = encodeRow(row)
|
|
170
|
+
|
|
171
|
+
hash.update(encoded)
|
|
172
|
+
|
|
173
|
+
rows++
|
|
174
|
+
|
|
175
|
+
if (countryIndex >= 0) {
|
|
176
|
+
const country = String(row[2 * (countryIndex + offset) + 1] ?? "")
|
|
177
|
+
const countryHash = byCountry.get(country) ?? createHash("sha256")
|
|
178
|
+
|
|
179
|
+
countryHash.update(encoded)
|
|
180
|
+
byCountry.set(country, countryHash)
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
return {
|
|
185
|
+
rows,
|
|
186
|
+
digest: hash.digest("hex"),
|
|
187
|
+
...(countryIndex >= 0
|
|
188
|
+
? {
|
|
189
|
+
byCountry: Object.fromEntries(
|
|
190
|
+
[...byCountry].toSorted(([a], [b]) => a.localeCompare(b)).map(([country, h]) => [country, h.digest("hex")])
|
|
191
|
+
),
|
|
192
|
+
}
|
|
193
|
+
: {}),
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* One row as hash input: each value after its SQLite storage type, with blobs in hex.
|
|
199
|
+
*/
|
|
200
|
+
function encodeRow(row: readonly unknown[]): string {
|
|
201
|
+
const fields: string[] = []
|
|
202
|
+
|
|
203
|
+
for (let index = 0; index < row.length; index += 2) {
|
|
204
|
+
const type = String(row[index])
|
|
205
|
+
const value = row[index + 1]
|
|
206
|
+
|
|
207
|
+
fields.push(`${type}:${value instanceof Uint8Array ? Buffer.from(value).toString("hex") : String(value)}`)
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
return `${fields.join(FIELD_SEPARATOR)}${ROW_SEPARATOR}`
|
|
211
|
+
}
|
package/lib/sealed.ts
CHANGED
|
@@ -27,9 +27,10 @@ import { assertUnsealedForWrite } from "#sealed/db"
|
|
|
27
27
|
* Builders set `write: true` when working on UNsealed staging.
|
|
28
28
|
* A sealed file raises `SealedArtifactError`.
|
|
29
29
|
*
|
|
30
|
-
* Together with `new DatabaseClient(path)
|
|
30
|
+
* Together with `new DatabaseClient(path)`, this function is one of the two
|
|
31
|
+
* ways a connection comes into being.
|
|
31
32
|
* `DatabaseSync` is constructed in exactly one place, inside `DatabaseClient`,
|
|
32
|
-
* so
|
|
33
|
+
* so callers never hold a raw handle and no database is described by two schemas.
|
|
33
34
|
*/
|
|
34
35
|
export async function openBuiltClient<DB = Database>(
|
|
35
36
|
path: PathBuilderLike,
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared setup for each layer's `scripts/ingest-chunk.ts`.
|
|
3
|
+
*
|
|
4
|
+
* Each chunk runs in a new process because JavaScript cannot reset h3's WebAssembly heap.
|
|
5
|
+
* This helper parses shared flags, opens the database created by the parent,
|
|
6
|
+
* runs the chunk and prints its result as one JSON line.
|
|
7
|
+
*
|
|
8
|
+
* Standard output contains only the result.
|
|
9
|
+
* Progress goes to standard error.
|
|
10
|
+
*/
|
|
11
|
+
import { parseArguments, type ParseArgsConfig } from "@mailwoman/core/scripting/arguments";
|
|
12
|
+
import { DatabaseClient } from "#client";
|
|
13
|
+
/**
|
|
14
|
+
* Flags shared by all ingest-chunk scripts.
|
|
15
|
+
*
|
|
16
|
+
* Each script includes these in its options so this helper can read them
|
|
17
|
+
* alongside the script's typed values.
|
|
18
|
+
*/
|
|
19
|
+
export declare const INGEST_CHUNK_FLAGS: {
|
|
20
|
+
readonly database: {
|
|
21
|
+
readonly type: "string";
|
|
22
|
+
};
|
|
23
|
+
readonly "index-resolution": {
|
|
24
|
+
readonly type: "string";
|
|
25
|
+
};
|
|
26
|
+
readonly "coverage-resolution": {
|
|
27
|
+
readonly type: "string";
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Shared settings passed to a chunk.
|
|
32
|
+
*/
|
|
33
|
+
export interface IngestChunkScriptContext {
|
|
34
|
+
indexResolution: number;
|
|
35
|
+
coverageResolution: number;
|
|
36
|
+
/**
|
|
37
|
+
* Writes progress to stderr with the shared chunk prefix.
|
|
38
|
+
*/
|
|
39
|
+
onProgress: (message: string) => void;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Parse flags and open the parent's database.
|
|
43
|
+
* Then run one chunk and print its JSON result.
|
|
44
|
+
*/
|
|
45
|
+
export declare function runIngestChunkScript<DB, const Options extends NonNullable<ParseArgsConfig["options"]> & typeof INGEST_CHUNK_FLAGS>(config: {
|
|
46
|
+
/**
|
|
47
|
+
* Script name used in error messages, e.g. `flood ingest-chunk`.
|
|
48
|
+
*/
|
|
49
|
+
context: string;
|
|
50
|
+
/**
|
|
51
|
+
* All script flags, including {@link INGEST_CHUNK_FLAGS}.
|
|
52
|
+
*/
|
|
53
|
+
options: Options;
|
|
54
|
+
run: (database: DatabaseClient<DB>, values: ReturnType<typeof parseArguments<{
|
|
55
|
+
options: Options;
|
|
56
|
+
}>>["values"], chunk: IngestChunkScriptContext) => Promise<unknown>;
|
|
57
|
+
}): Promise<void>;
|
|
58
|
+
//# sourceMappingURL=ingest-chunk-script.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ingest-chunk-script.d.ts","sourceRoot":"","sources":["../lib/ingest-chunk-script.ts"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AAEH,OAAO,EAAE,cAAc,EAAoB,KAAK,eAAe,EAAE,MAAM,qCAAqC,CAAA;AAG5G,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAExC;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB;;iBAClB,IAAI,EAAE,QAAQ;;;iBACJ,IAAI,EAAE,QAAQ;;;iBACX,IAAI,EAAE,QAAQ;;CACO,CAAA;AAE/C;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC,eAAe,EAAE,MAAM,CAAA;IACvB,kBAAkB,EAAE,MAAM,CAAA;IAC1B;;OAEG;IACH,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CACrC;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CACzC,EAAE,EACF,KAAK,CAAC,OAAO,SAAS,WAAW,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,GAAG,OAAO,kBAAkB,EACxF,MAAM,EAAE;IACT;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,OAAO,EAAE,OAAO,CAAA;IAChB,GAAG,EAAE,CACJ,QAAQ,EAAE,cAAc,CAAC,EAAE,CAAC,EAC5B,MAAM,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EACzE,KAAK,EAAE,wBAAwB,KAC3B,OAAO,CAAC,OAAO,CAAC,CAAA;CACrB,GAAG,OAAO,CAAC,IAAI,CAAC,CAsBhB"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
/**
|
|
4
|
+
* Shared setup for each layer's `scripts/ingest-chunk.ts`.
|
|
5
|
+
*
|
|
6
|
+
* Each chunk runs in a new process because JavaScript cannot reset h3's WebAssembly heap.
|
|
7
|
+
* This helper parses shared flags, opens the database created by the parent,
|
|
8
|
+
* runs the chunk and prints its result as one JSON line.
|
|
9
|
+
*
|
|
10
|
+
* Standard output contains only the result.
|
|
11
|
+
* Progress goes to standard error.
|
|
12
|
+
*/
|
|
13
|
+
import { parseArguments, requiredArgument } from "@mailwoman/core/scripting/arguments";
|
|
14
|
+
import { stringifyJSON } from "@mailwoman/core/values/json";
|
|
15
|
+
import { DatabaseClient } from "#client";
|
|
16
|
+
/**
|
|
17
|
+
* Flags shared by all ingest-chunk scripts.
|
|
18
|
+
*
|
|
19
|
+
* Each script includes these in its options so this helper can read them
|
|
20
|
+
* alongside the script's typed values.
|
|
21
|
+
*/
|
|
22
|
+
export const INGEST_CHUNK_FLAGS = {
|
|
23
|
+
database: { type: "string" },
|
|
24
|
+
"index-resolution": { type: "string" },
|
|
25
|
+
"coverage-resolution": { type: "string" },
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Parse flags and open the parent's database.
|
|
29
|
+
* Then run one chunk and print its JSON result.
|
|
30
|
+
*/
|
|
31
|
+
export async function runIngestChunkScript(config) {
|
|
32
|
+
const { values } = parseArguments({ options: config.options });
|
|
33
|
+
// Parse shared flags separately because the generic values above are not concrete inside this function.
|
|
34
|
+
// Narrow the lenient parse's values to strings.
|
|
35
|
+
const { values: shared } = parseArguments({ options: INGEST_CHUNK_FLAGS, strict: false });
|
|
36
|
+
const sharedFlag = (name) => requiredArgument(config.context, name, typeof shared[name] === "string" ? shared[name] : null);
|
|
37
|
+
using database = new DatabaseClient(sharedFlag("database"));
|
|
38
|
+
database.exec("PRAGMA journal_mode = OFF");
|
|
39
|
+
database.exec("PRAGMA synchronous = OFF");
|
|
40
|
+
const result = await config.run(database, values, {
|
|
41
|
+
indexResolution: Number(sharedFlag("index-resolution")),
|
|
42
|
+
coverageResolution: Number(sharedFlag("coverage-resolution")),
|
|
43
|
+
onProgress: (message) => console.error(` [chunk] ${message}`),
|
|
44
|
+
});
|
|
45
|
+
console.log(stringifyJSON(result));
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=ingest-chunk-script.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3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A0B,CAAC,CAAA;IAEzC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE;QACjD,eAAe,EAAE,MAAM,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC;QACvD,kBAAkB,EAAE,MAAM,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC;QAC7D,UAAU,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,aAAa,OAAO,EAAE,CAAC;KAC9D,CAAC,CAAA;IAEF,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAA;AACnC,CAAC"}
|
package/out/introspection.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file Questions asked of `sqlite_master`.
|
|
3
3
|
*
|
|
4
|
-
* its own subpath on purpose
|
|
5
|
-
* reaches `node:sqlite`, and the docs demo bundles this package for
|
|
6
|
-
*
|
|
7
|
-
* pure-SQL questions reachable from
|
|
4
|
+
* This module has its own subpath on purpose. Do not fold it into the package barrel. The
|
|
5
|
+
* `@mailwoman/sqlite` root export reaches `node:sqlite`, and the docs demo bundles this package for
|
|
6
|
+
* the browser. A consumer that imports the barrel to ask whether a table exists would pull the
|
|
7
|
+
* builtin into that graph. The separate subpath keeps these three pure-SQL questions reachable from
|
|
8
|
+
* a bundled consumer.
|
|
8
9
|
*/
|
|
9
10
|
import type { DatabaseClient } from "#client";
|
|
10
11
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"introspection.d.ts","sourceRoot":"","sources":["../lib/introspection.ts"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"introspection.d.ts","sourceRoot":"","sources":["../lib/introspection.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;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.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"introspection.js","sourceRoot":"","sources":["../lib/introspection.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;
|
|
1
|
+
{"version":3,"file":"introspection.js","sourceRoot":"","sources":["../lib/introspection.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAclE;;;;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,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The shared shape of a reader over one SQLite artifact.
|
|
3
3
|
*
|
|
4
|
-
* A lookup either opens the file it is given or adopts a connection already held
|
|
5
|
-
*
|
|
4
|
+
* A lookup either opens the file it is given or adopts a connection already held by the caller.
|
|
5
|
+
* It closes on disposal only the connection it opened.
|
|
6
6
|
*/
|
|
7
7
|
import type { PathBuilderLike } from "path-ts";
|
|
8
8
|
import { DatabaseClient, type DatabaseSyncOptions } from "#client";
|
package/out/sealed/build.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../lib/sealed/build.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../lib/sealed/build.ts"],"names":[],"mappings":"AAIA,OAAO,EAAW,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AAEvD,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,CAkEjB"}
|
package/out/sealed/build.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
2
|
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
-
import { removePathIfPresent } from "@mailwoman/core/fs/writers";
|
|
3
|
+
import { makeDirectories, removePathIfPresent } from "@mailwoman/core/fs/writers";
|
|
4
|
+
import { dirname } from "path-ts";
|
|
4
5
|
import { DatabaseClient } from "#client";
|
|
5
6
|
import { recoverInterruptedBuilds, sealDatabase, swapDatabaseIntoPlace } from "#sealed/db";
|
|
6
7
|
/**
|
|
@@ -8,6 +9,8 @@ import { recoverInterruptedBuilds, sealDatabase, swapDatabaseIntoPlace } from "#
|
|
|
8
9
|
*/
|
|
9
10
|
export async function buildSealedArtifact(options) {
|
|
10
11
|
const tmpPath = `${options.out}.tmp-${process.pid}`;
|
|
12
|
+
// SQLite creates the temp file but not its directory, and a new artifact's directory may not exist yet.
|
|
13
|
+
await makeDirectories(dirname(options.out.toString()));
|
|
11
14
|
// A killed earlier build's temp file is removed before this one writes its own, and a version
|
|
12
15
|
// it set aside moves back into an empty slot so readers keep a database while this build runs.
|
|
13
16
|
await recoverInterruptedBuilds(options.out);
|
package/out/sealed/build.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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;
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../lib/sealed/build.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAElE,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AACjF,OAAO,EAAE,OAAO,EAAwB,MAAM,SAAS,CAAA;AAEvD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACxC,OAAO,EAAE,wBAAwB,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AA+B1F;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACxC,OAAyD;IAEzD,MAAM,OAAO,GAAG,GAAG,OAAO,CAAC,G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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"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { DatabaseClient } from "#client";
|
|
2
|
+
/**
|
|
3
|
+
* The columns a build writes from its own clock or checkout, left out of every digest by default.
|
|
4
|
+
*/
|
|
5
|
+
export declare const BUILD_STAMP_COLUMNS: Readonly<Record<string, readonly string[]>>;
|
|
6
|
+
/**
|
|
7
|
+
* What a content digest leaves out, and how it splits a table by country.
|
|
8
|
+
*/
|
|
9
|
+
export interface ContentDigestSpec {
|
|
10
|
+
/**
|
|
11
|
+
* Tables left out by name, beside the `sqlite_*` tables and every virtual table's shadow tables.
|
|
12
|
+
*/
|
|
13
|
+
excludeTables?: readonly string[];
|
|
14
|
+
/**
|
|
15
|
+
* Columns left out per table.
|
|
16
|
+
* Defaults to {@linkcode BUILD_STAMP_COLUMNS}.
|
|
17
|
+
*/
|
|
18
|
+
excludeColumns?: Readonly<Record<string, readonly string[]>>;
|
|
19
|
+
/**
|
|
20
|
+
* A column whose value also splits each table that has it into one digest per value,
|
|
21
|
+
* so a change can be traced to the countries it touched.
|
|
22
|
+
*/
|
|
23
|
+
countryColumn?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* One table's digest.
|
|
27
|
+
*/
|
|
28
|
+
export interface TableContentDigest {
|
|
29
|
+
rows: number;
|
|
30
|
+
digest: string;
|
|
31
|
+
/**
|
|
32
|
+
* One digest per value of the spec's country column, when the table has that column.
|
|
33
|
+
*/
|
|
34
|
+
byCountry?: Record<string, string>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A database's content digest: one digest per table and a root digest over them all.
|
|
38
|
+
*/
|
|
39
|
+
export interface DatabaseContentDigest {
|
|
40
|
+
root: string;
|
|
41
|
+
tables: Record<string, TableContentDigest>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The digest of every table's rows, read in primary-key order, or in the order of all columns
|
|
45
|
+
* for a table without a primary key, so insertion order and page layout leave it unchanged.
|
|
46
|
+
*
|
|
47
|
+
* A virtual table is read through its own rows, in rowid order, and its shadow
|
|
48
|
+
* tables (`<name>_data`, `<name>_node` and the rest) are left out, because they
|
|
49
|
+
* store an index layout that depends on insertion order.
|
|
50
|
+
* Each value is tagged with its storage type, so the integer `1` and the real `1.0` digest differently.
|
|
51
|
+
*/
|
|
52
|
+
export declare function databaseContentDigest<DB>(db: DatabaseClient<DB>, spec?: ContentDigestSpec): DatabaseContentDigest;
|
|
53
|
+
//# sourceMappingURL=digest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"digest.d.ts","sourceRoot":"","sources":["../../lib/sealed/digest.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAG7C;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAE3E,CAAA;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACjC;;;OAGG;IACH,cAAc,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,CAAA;IAC5D;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAA;CAC1C;AAiBD;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,EAAE,EAAE,cAAc,CAAC,EAAE,CAAC,EAAE,IAAI,GAAE,iBAAsB,GAAG,qBAAqB,CAgCrH"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
/**
|
|
4
|
+
* @file A digest of a database's table contents, equal for two databases that hold the same rows.
|
|
5
|
+
*
|
|
6
|
+
* A file's md5 differs between two builds of the same rows, because page layout, free pages and a
|
|
7
|
+
* build timestamp all reach the bytes. This digest reads rows in key order instead, so a cached
|
|
8
|
+
* build and a build from scratch compare equal exactly when every table holds the same rows.
|
|
9
|
+
*
|
|
10
|
+
* `@mailwoman/core` depends on this package, so hashing comes from `node:crypto` here, the module
|
|
11
|
+
* core's hash helpers wrap.
|
|
12
|
+
*/
|
|
13
|
+
import { createHash } from "node:crypto";
|
|
14
|
+
import { listTables } from "#introspection";
|
|
15
|
+
/**
|
|
16
|
+
* The columns a build writes from its own clock or checkout, left out of every digest by default.
|
|
17
|
+
*/
|
|
18
|
+
export const BUILD_STAMP_COLUMNS = {
|
|
19
|
+
layer_manifest: ["created_at", "build_sha"],
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Separates the fields of one row in the hash input.
|
|
23
|
+
*/
|
|
24
|
+
const FIELD_SEPARATOR = "\u0000";
|
|
25
|
+
/**
|
|
26
|
+
* Ends one row in the hash input.
|
|
27
|
+
*/
|
|
28
|
+
const ROW_SEPARATOR = "\u0001";
|
|
29
|
+
/**
|
|
30
|
+
* The digest of every table's rows, read in primary-key order, or in the order of all columns
|
|
31
|
+
* for a table without a primary key, so insertion order and page layout leave it unchanged.
|
|
32
|
+
*
|
|
33
|
+
* A virtual table is read through its own rows, in rowid order, and its shadow
|
|
34
|
+
* tables (`<name>_data`, `<name>_node` and the rest) are left out, because they
|
|
35
|
+
* store an index layout that depends on insertion order.
|
|
36
|
+
* Each value is tagged with its storage type, so the integer `1` and the real `1.0` digest differently.
|
|
37
|
+
*/
|
|
38
|
+
export function databaseContentDigest(db, spec = {}) {
|
|
39
|
+
const excludeColumns = spec.excludeColumns ?? BUILD_STAMP_COLUMNS;
|
|
40
|
+
const excludeTables = new Set(spec.excludeTables);
|
|
41
|
+
const virtualTables = db
|
|
42
|
+
.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND sql LIKE 'CREATE VIRTUAL TABLE%'")
|
|
43
|
+
.all().map((row) => row.name);
|
|
44
|
+
const isShadow = (table) => virtualTables.some((name) => table.startsWith(`${name}_`));
|
|
45
|
+
const tables = {};
|
|
46
|
+
for (const table of listTables(db)) {
|
|
47
|
+
if (table.startsWith("sqlite_") || excludeTables.has(table) || isShadow(table))
|
|
48
|
+
continue;
|
|
49
|
+
tables[table] = digestTable(db, table, {
|
|
50
|
+
virtual: virtualTables.includes(table),
|
|
51
|
+
excluded: new Set(excludeColumns[table]),
|
|
52
|
+
countryColumn: spec.countryColumn,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
const root = createHash("sha256");
|
|
56
|
+
for (const [table, { digest }] of Object.entries(tables)) {
|
|
57
|
+
root.update(`${table}${FIELD_SEPARATOR}${digest}${ROW_SEPARATOR}`);
|
|
58
|
+
}
|
|
59
|
+
return { root: root.digest("hex"), tables };
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The digest of one table, with its per-country split.
|
|
63
|
+
*/
|
|
64
|
+
function digestTable(db, table, options) {
|
|
65
|
+
const columnInfo = db
|
|
66
|
+
.prepare(`PRAGMA table_info("${table}")`)
|
|
67
|
+
.all()
|
|
68
|
+
.map((row) => ({ name: String(row["name"]), pk: Number(row["pk"]) }));
|
|
69
|
+
const columns = columnInfo.map((column) => column.name).filter((name) => !options.excluded.has(name));
|
|
70
|
+
const keyColumns = columnInfo
|
|
71
|
+
.filter((column) => column.pk > 0)
|
|
72
|
+
.toSorted((a, b) => a.pk - b.pk)
|
|
73
|
+
.map((column) => column.name);
|
|
74
|
+
const quoted = (name) => `"${name.replaceAll('"', '""')}"`;
|
|
75
|
+
const selected = (options.virtual ? ["rowid", ...columns] : columns).flatMap((name) => [
|
|
76
|
+
`typeof(${quoted(name)})`,
|
|
77
|
+
quoted(name),
|
|
78
|
+
]);
|
|
79
|
+
const order = options.virtual ? ["rowid"] : keyColumns.length ? keyColumns : columns;
|
|
80
|
+
const countryIndex = options.countryColumn ? columns.indexOf(options.countryColumn) : -1;
|
|
81
|
+
const offset = options.virtual ? 1 : 0;
|
|
82
|
+
const statement = db.prepare(`SELECT ${selected.join(", ")} FROM ${quoted(table)} ORDER BY ${order.map(quoted).join(", ")}`);
|
|
83
|
+
// A 64-bit id past 2^53 loses precision as a JavaScript number.
|
|
84
|
+
statement.setReadBigInts(true);
|
|
85
|
+
statement.setReturnArrays(true);
|
|
86
|
+
const hash = createHash("sha256");
|
|
87
|
+
const byCountry = new Map();
|
|
88
|
+
let rows = 0;
|
|
89
|
+
for (const row of statement.iterate()) {
|
|
90
|
+
const encoded = encodeRow(row);
|
|
91
|
+
hash.update(encoded);
|
|
92
|
+
rows++;
|
|
93
|
+
if (countryIndex >= 0) {
|
|
94
|
+
const country = String(row[2 * (countryIndex + offset) + 1] ?? "");
|
|
95
|
+
const countryHash = byCountry.get(country) ?? createHash("sha256");
|
|
96
|
+
countryHash.update(encoded);
|
|
97
|
+
byCountry.set(country, countryHash);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return {
|
|
101
|
+
rows,
|
|
102
|
+
digest: hash.digest("hex"),
|
|
103
|
+
...(countryIndex >= 0
|
|
104
|
+
? {
|
|
105
|
+
byCountry: Object.fromEntries([...byCountry].toSorted(([a], [b]) => a.localeCompare(b)).map(([country, h]) => [country, h.digest("hex")])),
|
|
106
|
+
}
|
|
107
|
+
: {}),
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* One row as hash input: each value after its SQLite storage type, with blobs in hex.
|
|
112
|
+
*/
|
|
113
|
+
function encodeRow(row) {
|
|
114
|
+
const fields = [];
|
|
115
|
+
for (let index = 0; index < row.length; index += 2) {
|
|
116
|
+
const type = String(row[index]);
|
|
117
|
+
const value = row[index + 1];
|
|
118
|
+
fields.push(`${type}:${value instanceof Uint8Array ? Buffer.from(value).toString("hex") : String(value)}`);
|
|
119
|
+
}
|
|
120
|
+
return `${fields.join(FIELD_SEPARATOR)}${ROW_SEPARATOR}`;
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=digest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"digest.js","sourceRoot":"","sources":["../../lib/sealed/digest.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAElE;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAa,MAAM,aAAa,CAAA;AAGnD,OAAO,EAAE,U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AAE,CAAC;KACN,CAAA;AACF,CAAC;AAED;;GAEG;AACH,SAAS,SAAS,CAAC,GAAuB;IACzC,MAAM,MAAM,GAAa,EAAE,CAAA;IAE3B,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,GAAG,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QACpD,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAA;QAC/B,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,CAAA;QAE5B,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,KAAK,YAAY,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;IAC3G,CAAC;IAED,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,aAAa,EAAE,CAAA;AACzD,CAAC"}
|
package/out/sealed.d.ts
CHANGED
|
@@ -20,9 +20,10 @@ import type { Database } from "#database-schema";
|
|
|
20
20
|
* Builders set `write: true` when working on UNsealed staging.
|
|
21
21
|
* A sealed file raises `SealedArtifactError`.
|
|
22
22
|
*
|
|
23
|
-
* Together with `new DatabaseClient(path)
|
|
23
|
+
* Together with `new DatabaseClient(path)`, this function is one of the two
|
|
24
|
+
* ways a connection comes into being.
|
|
24
25
|
* `DatabaseSync` is constructed in exactly one place, inside `DatabaseClient`,
|
|
25
|
-
* so
|
|
26
|
+
* so callers never hold a raw handle and no database is described by two schemas.
|
|
26
27
|
*/
|
|
27
28
|
export declare function openBuiltClient<DB = Database>(path: PathBuilderLike, opts?: {
|
|
28
29
|
write?: boolean;
|
package/out/sealed.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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
|
|
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;;;;;;;;;;;GAWG;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
|
@@ -9,9 +9,10 @@ import { assertUnsealedForWrite } from "#sealed/db";
|
|
|
9
9
|
* Builders set `write: true` when working on UNsealed staging.
|
|
10
10
|
* A sealed file raises `SealedArtifactError`.
|
|
11
11
|
*
|
|
12
|
-
* Together with `new DatabaseClient(path)
|
|
12
|
+
* Together with `new DatabaseClient(path)`, this function is one of the two
|
|
13
|
+
* ways a connection comes into being.
|
|
13
14
|
* `DatabaseSync` is constructed in exactly one place, inside `DatabaseClient`,
|
|
14
|
-
* so
|
|
15
|
+
* so callers never hold a raw handle and no database is described by two schemas.
|
|
15
16
|
*/
|
|
16
17
|
export async function openBuiltClient(path, opts = {}) {
|
|
17
18
|
if (opts.write) {
|
package/out/sealed.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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
|
|
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;;;;;;;;;;;GAWG;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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"7.0.2","root":["../lib/client.test.ts","../lib/introspection.test.ts","../lib/lookup.test.ts","../lib/schema-columns.test.ts","../lib/sealed/sealed-db.test.ts"],"packageJsons":["../../../node_modules/@types/chai/package.json","../../../node_modules/@types/deep-eql/package.json","../../../node_modules/@types/node/package.json","../../../node_modules/@vitest/browser-playwright/package.json","../../../node_modules/@vitest/coverage-v8/package.json","../../../node_modules/@vitest/mocker/package.json","../../../node_modules/@vitest/ui/package.json","../../../node_modules/assertion-error/package.json","../../../node_modules/buffer/package.json","../../../node_modules/chai/package.json","../../../node_modules/deep-eql/package.json","../../../node_modules/esbuild/package.json","../../../node_modules/events/package.json","../../../node_modules/expect-type/package.json","../../../node_modules/jiti/package.json","../../../node_modules/jsdom/package.json","../../../node_modules/kysely/package.json","../../../node_modules/path-ts/package.json","../../../node_modules/pino-std-serializers/package.json","../../../node_modules/pino/package.json","../../../node_modules/punycode/package.json","../../../node_modules/read-excel-file/package.json","../../../node_modules/sonic-boom/package.json","../../../node_modules/spliterator/package.json","../../../node_modules/string_decoder/package.json","../../../node_modules/tagged-tag/package.json","../../../node_modules/terser/package.json","../../../node_modules/thread-stream/package.json","../../../node_modules/tinybench/package.json","../../../node_modules/type-fest/package.json","../../../node_modules/undici-types/package.json","../../../node_modules/vite/package.json","../../../node_modules/vitest/package.json","../../../node_modules/write-excel-file/package.json","../../../node_modules/yaml/package.json","../../core/package.json","../package.json"],"missingPackageJsons":["../../../node_modules/@edge-runtime/vm/package.json","../../../node_modules/@mailwoman/core/fs/readers/package.json","../../../node_modules/@mailwoman/core/fs/readers/stat/package.json","../../../node_modules/@mailwoman/core/fs/temporary/package.json","../../../node_modules/@mailwoman/core/fs/writers/package.json","../../../node_modules/@mailwoman/core/process/package.json","../../../node_modules/@opentelemetry/api/package.json","../../../node_modules/@types/assert/package.json","../../../node_modules/@types/assert/strict/package.json","../../../node_modules/@types/async_hooks/package.json","../../../node_modules/@types/child_process/package.json","../../../node_modules/@types/cluster/package.json","../../../node_modules/@types/console/package.json","../../../node_modules/@types/constants/package.json","../../../node_modules/@types/crypto/package.json","../../../node_modules/@types/dgram/package.json","../../../node_modules/@types/diagnostics_channel/package.json","../../../node_modules/@types/dns/package.json","../../../node_modules/@types/dns/promises/package.json","../../../node_modules/@types/domain/package.json","../../../node_modules/@types/events/package.json","../../../node_modules/@types/fs/package.json","../../../node_modules/@types/fs/promises/package.json","../../../node_modules/@types/http/package.json","../../../node_modules/@types/http2/package.json","../../../node_modules/@types/https/package.json","../../../node_modules/@types/inspector/package.json","../../../node_modules/@types/inspector/promises/package.json","../../../node_modules/@types/module/package.json","../../../node_modules/@types/net/package.json","../../../node_modules/@types/node/assert/package.json","../../../node_modules/@types/node/dns/package.json","../../../node_modules/@types/node/fs/package.json","../../../node_modules/@types/node/inspector/package.json","../../../node_modules/@types/node/path/package.json","../../../node_modules/@types/node/readline/package.json","../../../node_modules/@types/node/stream/package.json","../../../node_modules/@types/node/test/package.json","../../../node_modules/@types/node/timers/package.json","../../../node_modules/@types/node/util/package.json","../../../node_modules/@types/node/web-globals/package.json","../../../node_modules/@types/node/zlib/package.json","../../../node_modules/@types/os/package.json","../../../node_modules/@types/path/package.json","../../../node_modules/@types/path/posix/package.json","../../../node_modules/@types/path/win32/package.json","../../../node_modules/@types/perf_hooks/package.json","../../../node_modules/@types/process/package.json","../../../node_modules/@types/punycode/package.json","../../../node_modules/@types/querystring/package.json","../../../node_modules/@types/readline/package.json","../../../node_modules/@types/readline/promises/package.json","../../../node_modules/@types/repl/package.json","../../../node_modules/@types/stream/consumers/package.json","../../../node_modules/@types/stream/iter/package.json","../../../node_modules/@types/stream/package.json","../../../node_modules/@types/stream/promises/package.json","../../../node_modules/@types/stream/web/package.json","../../../node_modules/@types/string_decoder/package.json","../../../node_modules/@types/timers/package.json","../../../node_modules/@types/timers/promises/package.json","../../../node_modules/@types/tls/package.json","../../../node_modules/@types/trace_events/package.json","../../../node_modules/@types/tty/package.json","../../../node_modules/@types/url/package.json","../../../node_modules/@types/util/package.json","../../../node_modules/@types/util/types/package.json","../../../node_modules/@types/v8/package.json","../../../node_modules/@types/vm/package.json","../../../node_modules/@types/wasi/package.json","../../../node_modules/@types/worker_threads/package.json","../../../node_modules/@types/zlib/package.json","../../../node_modules/@vitejs/devtools/package.json","../../../node_modules/@vitest/browser-preview/package.json","../../../node_modules/@vitest/browser-webdriverio/package.json","../../../node_modules/@vitest/coverage-istanbul/package.json","../../../node_modules/@vitest/mocker/dist/package.json","../../../node_modules/assert/package.json","../../../node_modules/assert/strict/package.json","../../../node_modules/async_hooks/package.json","../../../node_modules/child_process/package.json","../../../node_modules/cluster/package.json","../../../node_modules/console/package.json","../../../node_modules/constants/package.json","../../../node_modules/crypto/package.json","../../../node_modules/dgram/package.json","../../../node_modules/diagnostics_channel/package.json","../../../node_modules/dns/package.json","../../../node_modules/dns/promises/package.json","../../../node_modules/domain/package.json","../../../node_modules/expect-type/dist/package.json","../../../node_modules/fs/package.json","../../../node_modules/fs/promises/package.json","../../../node_modules/happy-dom/package.json","../../../node_modules/http/package.json","../../../node_modules/http2/package.json","../../../node_modules/https/package.json","../../../node_modules/inspector/package.json","../../../node_modules/inspector/promises/package.json","../../../node_modules/kysely/dist/dialect/mssql/package.json","../../../node_modules/kysely/dist/dialect/mysql/package.json","../../../node_modules/kysely/dist/dialect/package.json","../../../node_modules/kysely/dist/dialect/pglite/package.json","../../../node_modules/kysely/dist/dialect/postgres/package.json","../../../node_modules/kysely/dist/dialect/sqlite/package.json","../../../node_modules/kysely/dist/driver/package.json","../../../node_modules/kysely/dist/dynamic/package.json","../../../node_modules/kysely/dist/expression/package.json","../../../node_modules/kysely/dist/operation-node/package.json","../../../node_modules/kysely/dist/package.json","../../../node_modules/kysely/dist/parser/package.json","../../../node_modules/kysely/dist/plugin/camel-case/package.json","../../../node_modules/kysely/dist/plugin/deduplicate-joins/package.json","../../../node_modules/kysely/dist/plugin/handle-empty-in-lists/package.json","../../../node_modules/kysely/dist/plugin/package.json","../../../node_modules/kysely/dist/plugin/parse-json-results/package.json","../../../node_modules/kysely/dist/plugin/safe-null-comparison/package.json","../../../node_modules/kysely/dist/plugin/with-schema/package.json","../../../node_modules/kysely/dist/query-builder/package.json","../../../node_modules/kysely/dist/query-compiler/package.json","../../../node_modules/kysely/dist/query-executor/package.json","../../../node_modules/kysely/dist/raw-builder/package.json","../../../node_modules/kysely/dist/schema/package.json","../../../node_modules/kysely/dist/util/package.json","../../../node_modules/less/package.json","../../../node_modules/module/package.json","../../../node_modules/msw/package.json","../../../node_modules/net/package.json","../../../node_modules/os/package.json","../../../node_modules/path-ts/out/lib/package.json","../../../node_modules/path-ts/out/package.json","../../../node_modules/path/package.json","../../../node_modules/path/posix/package.json","../../../node_modules/path/win32/package.json","../../../node_modules/perf_hooks/package.json","../../../node_modules/process/package.json","../../../node_modules/querystring/package.json","../../../node_modules/readline/package.json","../../../node_modules/readline/promises/package.json","../../../node_modules/repl/package.json","../../../node_modules/sass-embedded/package.json","../../../node_modules/sass/package.json","../../../node_modules/sonic-boom/types/package.json","../../../node_modules/spliterator/node/fs/package.json","../../../node_modules/spliterator/out/lib/core/package.json","../../../node_modules/spliterator/out/lib/formats/package.json","../../../node_modules/spliterator/out/lib/internal/package.json","../../../node_modules/spliterator/out/lib/io/package.json","../../../node_modules/spliterator/out/lib/iterators/package.json","../../../node_modules/spliterator/out/lib/package.json","../../../node_modules/spliterator/out/lib/parallel/package.json","../../../node_modules/spliterator/out/node/fs/package.json","../../../node_modules/spliterator/out/node/package.json","../../../node_modules/spliterator/out/package.json","../../../node_modules/stream/consumers/package.json","../../../node_modules/stream/iter/package.json","../../../node_modules/stream/package.json","../../../node_modules/stream/promises/package.json","../../../node_modules/stream/web/package.json","../../../node_modules/stylus/package.json","../../../node_modules/sugarss/package.json","../../../node_modules/timers/package.json","../../../node_modules/timers/promises/package.json","../../../node_modules/tinybench/dist/package.json","../../../node_modules/tls/package.json","../../../node_modules/trace_events/package.json","../../../node_modules/tsx/package.json","../../../node_modules/tty/package.json","../../../node_modules/type-fest/source/internal/package.json","../../../node_modules/type-fest/source/package.json","../../../node_modules/url/package.json","../../../node_modules/util/package.json","../../../node_modules/util/types/package.json","../../../node_modules/v8/package.json","../../../node_modules/vite/dist/node/chunks/package.json","../../../node_modules/vite/dist/node/package.json","../../../node_modules/vite/dist/package.json","../../../node_modules/vite/module-runner/package.json","../../../node_modules/vite/types/package.json","../../../node_modules/vitest/dist/chunks/package.json","../../../node_modules/vitest/dist/package.json","../../../node_modules/vm/package.json","../../../node_modules/wasi/package.json","../../../node_modules/worker_threads/package.json","../../../node_modules/zlib/package.json"]}
|
|
1
|
+
{"version":"7.0.2","root":["../lib/client.test.ts","../lib/introspection.test.ts","../lib/lookup.test.ts","../lib/schema-columns.test.ts","../lib/sealed/build.test.ts","../lib/sealed/digest.test.ts","../lib/sealed/sealed-db.test.ts"],"packageJsons":["../../../node_modules/@types/chai/package.json","../../../node_modules/@types/deep-eql/package.json","../../../node_modules/@types/node/package.json","../../../node_modules/@vitest/browser-playwright/package.json","../../../node_modules/@vitest/coverage-v8/package.json","../../../node_modules/@vitest/mocker/package.json","../../../node_modules/@vitest/ui/package.json","../../../node_modules/assertion-error/package.json","../../../node_modules/buffer/package.json","../../../node_modules/chai/package.json","../../../node_modules/deep-eql/package.json","../../../node_modules/esbuild/package.json","../../../node_modules/events/package.json","../../../node_modules/expect-type/package.json","../../../node_modules/jiti/package.json","../../../node_modules/jsdom/package.json","../../../node_modules/kysely/package.json","../../../node_modules/path-ts/package.json","../../../node_modules/pino-std-serializers/package.json","../../../node_modules/pino/package.json","../../../node_modules/punycode/package.json","../../../node_modules/read-excel-file/package.json","../../../node_modules/sonic-boom/package.json","../../../node_modules/spliterator/package.json","../../../node_modules/string_decoder/package.json","../../../node_modules/tagged-tag/package.json","../../../node_modules/terser/package.json","../../../node_modules/thread-stream/package.json","../../../node_modules/tinybench/package.json","../../../node_modules/type-fest/package.json","../../../node_modules/undici-types/package.json","../../../node_modules/vite/package.json","../../../node_modules/vitest/package.json","../../../node_modules/write-excel-file/package.json","../../../node_modules/yaml/package.json","../../core/package.json","../package.json"],"missingPackageJsons":["../../../node_modules/@edge-runtime/vm/package.json","../../../node_modules/@mailwoman/core/fs/readers/package.json","../../../node_modules/@mailwoman/core/fs/readers/stat/package.json","../../../node_modules/@mailwoman/core/fs/temporary/package.json","../../../node_modules/@mailwoman/core/fs/writers/package.json","../../../node_modules/@mailwoman/core/scripting/process/package.json","../../../node_modules/@opentelemetry/api/package.json","../../../node_modules/@types/assert/package.json","../../../node_modules/@types/assert/strict/package.json","../../../node_modules/@types/async_hooks/package.json","../../../node_modules/@types/child_process/package.json","../../../node_modules/@types/cluster/package.json","../../../node_modules/@types/console/package.json","../../../node_modules/@types/constants/package.json","../../../node_modules/@types/crypto/package.json","../../../node_modules/@types/dgram/package.json","../../../node_modules/@types/diagnostics_channel/package.json","../../../node_modules/@types/dns/package.json","../../../node_modules/@types/dns/promises/package.json","../../../node_modules/@types/domain/package.json","../../../node_modules/@types/events/package.json","../../../node_modules/@types/fs/package.json","../../../node_modules/@types/fs/promises/package.json","../../../node_modules/@types/http/package.json","../../../node_modules/@types/http2/package.json","../../../node_modules/@types/https/package.json","../../../node_modules/@types/inspector/package.json","../../../node_modules/@types/inspector/promises/package.json","../../../node_modules/@types/module/package.json","../../../node_modules/@types/net/package.json","../../../node_modules/@types/node/assert/package.json","../../../node_modules/@types/node/dns/package.json","../../../node_modules/@types/node/fs/package.json","../../../node_modules/@types/node/inspector/package.json","../../../node_modules/@types/node/path/package.json","../../../node_modules/@types/node/readline/package.json","../../../node_modules/@types/node/stream/package.json","../../../node_modules/@types/node/test/package.json","../../../node_modules/@types/node/timers/package.json","../../../node_modules/@types/node/util/package.json","../../../node_modules/@types/node/web-globals/package.json","../../../node_modules/@types/node/zlib/package.json","../../../node_modules/@types/os/package.json","../../../node_modules/@types/path/package.json","../../../node_modules/@types/path/posix/package.json","../../../node_modules/@types/path/win32/package.json","../../../node_modules/@types/perf_hooks/package.json","../../../node_modules/@types/process/package.json","../../../node_modules/@types/punycode/package.json","../../../node_modules/@types/querystring/package.json","../../../node_modules/@types/readline/package.json","../../../node_modules/@types/readline/promises/package.json","../../../node_modules/@types/repl/package.json","../../../node_modules/@types/stream/consumers/package.json","../../../node_modules/@types/stream/iter/package.json","../../../node_modules/@types/stream/package.json","../../../node_modules/@types/stream/promises/package.json","../../../node_modules/@types/stream/web/package.json","../../../node_modules/@types/string_decoder/package.json","../../../node_modules/@types/timers/package.json","../../../node_modules/@types/timers/promises/package.json","../../../node_modules/@types/tls/package.json","../../../node_modules/@types/trace_events/package.json","../../../node_modules/@types/tty/package.json","../../../node_modules/@types/url/package.json","../../../node_modules/@types/util/package.json","../../../node_modules/@types/util/types/package.json","../../../node_modules/@types/v8/package.json","../../../node_modules/@types/vm/package.json","../../../node_modules/@types/wasi/package.json","../../../node_modules/@types/worker_threads/package.json","../../../node_modules/@types/zlib/package.json","../../../node_modules/@vitejs/devtools/package.json","../../../node_modules/@vitest/browser-preview/package.json","../../../node_modules/@vitest/browser-webdriverio/package.json","../../../node_modules/@vitest/coverage-istanbul/package.json","../../../node_modules/@vitest/mocker/dist/package.json","../../../node_modules/assert/package.json","../../../node_modules/assert/strict/package.json","../../../node_modules/async_hooks/package.json","../../../node_modules/child_process/package.json","../../../node_modules/cluster/package.json","../../../node_modules/console/package.json","../../../node_modules/constants/package.json","../../../node_modules/crypto/package.json","../../../node_modules/dgram/package.json","../../../node_modules/diagnostics_channel/package.json","../../../node_modules/dns/package.json","../../../node_modules/dns/promises/package.json","../../../node_modules/domain/package.json","../../../node_modules/expect-type/dist/package.json","../../../node_modules/fs/package.json","../../../node_modules/fs/promises/package.json","../../../node_modules/happy-dom/package.json","../../../node_modules/http/package.json","../../../node_modules/http2/package.json","../../../node_modules/https/package.json","../../../node_modules/inspector/package.json","../../../node_modules/inspector/promises/package.json","../../../node_modules/kysely/dist/dialect/mssql/package.json","../../../node_modules/kysely/dist/dialect/mysql/package.json","../../../node_modules/kysely/dist/dialect/package.json","../../../node_modules/kysely/dist/dialect/pglite/package.json","../../../node_modules/kysely/dist/dialect/postgres/package.json","../../../node_modules/kysely/dist/dialect/sqlite/package.json","../../../node_modules/kysely/dist/driver/package.json","../../../node_modules/kysely/dist/dynamic/package.json","../../../node_modules/kysely/dist/expression/package.json","../../../node_modules/kysely/dist/operation-node/package.json","../../../node_modules/kysely/dist/package.json","../../../node_modules/kysely/dist/parser/package.json","../../../node_modules/kysely/dist/plugin/camel-case/package.json","../../../node_modules/kysely/dist/plugin/deduplicate-joins/package.json","../../../node_modules/kysely/dist/plugin/handle-empty-in-lists/package.json","../../../node_modules/kysely/dist/plugin/package.json","../../../node_modules/kysely/dist/plugin/parse-json-results/package.json","../../../node_modules/kysely/dist/plugin/safe-null-comparison/package.json","../../../node_modules/kysely/dist/plugin/with-schema/package.json","../../../node_modules/kysely/dist/query-builder/package.json","../../../node_modules/kysely/dist/query-compiler/package.json","../../../node_modules/kysely/dist/query-executor/package.json","../../../node_modules/kysely/dist/raw-builder/package.json","../../../node_modules/kysely/dist/schema/package.json","../../../node_modules/kysely/dist/util/package.json","../../../node_modules/less/package.json","../../../node_modules/module/package.json","../../../node_modules/msw/package.json","../../../node_modules/net/package.json","../../../node_modules/os/package.json","../../../node_modules/path-ts/out/lib/package.json","../../../node_modules/path-ts/out/package.json","../../../node_modules/path/package.json","../../../node_modules/path/posix/package.json","../../../node_modules/path/win32/package.json","../../../node_modules/perf_hooks/package.json","../../../node_modules/process/package.json","../../../node_modules/querystring/package.json","../../../node_modules/readline/package.json","../../../node_modules/readline/promises/package.json","../../../node_modules/repl/package.json","../../../node_modules/sass-embedded/package.json","../../../node_modules/sass/package.json","../../../node_modules/sonic-boom/types/package.json","../../../node_modules/spliterator/node/fs/package.json","../../../node_modules/spliterator/out/lib/core/package.json","../../../node_modules/spliterator/out/lib/formats/package.json","../../../node_modules/spliterator/out/lib/internal/package.json","../../../node_modules/spliterator/out/lib/io/package.json","../../../node_modules/spliterator/out/lib/iterators/package.json","../../../node_modules/spliterator/out/lib/package.json","../../../node_modules/spliterator/out/lib/parallel/package.json","../../../node_modules/spliterator/out/node/fs/package.json","../../../node_modules/spliterator/out/node/package.json","../../../node_modules/spliterator/out/package.json","../../../node_modules/stream/consumers/package.json","../../../node_modules/stream/iter/package.json","../../../node_modules/stream/package.json","../../../node_modules/stream/promises/package.json","../../../node_modules/stream/web/package.json","../../../node_modules/stylus/package.json","../../../node_modules/sugarss/package.json","../../../node_modules/timers/package.json","../../../node_modules/timers/promises/package.json","../../../node_modules/tinybench/dist/package.json","../../../node_modules/tls/package.json","../../../node_modules/trace_events/package.json","../../../node_modules/tsx/package.json","../../../node_modules/tty/package.json","../../../node_modules/type-fest/source/internal/package.json","../../../node_modules/type-fest/source/package.json","../../../node_modules/url/package.json","../../../node_modules/util/package.json","../../../node_modules/util/types/package.json","../../../node_modules/v8/package.json","../../../node_modules/vite/dist/node/chunks/package.json","../../../node_modules/vite/dist/node/package.json","../../../node_modules/vite/dist/package.json","../../../node_modules/vite/module-runner/package.json","../../../node_modules/vite/types/package.json","../../../node_modules/vitest/dist/chunks/package.json","../../../node_modules/vitest/dist/package.json","../../../node_modules/vm/package.json","../../../node_modules/wasi/package.json","../../../node_modules/worker_threads/package.json","../../../node_modules/zlib/package.json"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mailwoman/sqlite",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.3.0",
|
|
4
4
|
"description": "The one way a Mailwoman SQLite connection is opened: a typed Kysely client over node:sqlite, plus the sealed-artifact lifecycle.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"kysely",
|
|
@@ -75,9 +75,9 @@
|
|
|
75
75
|
"path-ts": "^2.5.0"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
|
-
"@mailwoman/core": "11.
|
|
78
|
+
"@mailwoman/core": "11.3.0"
|
|
79
79
|
},
|
|
80
80
|
"engines": {
|
|
81
|
-
"node": "^24.22.
|
|
81
|
+
"node": "^24.22.3 || >=26.13.1"
|
|
82
82
|
}
|
|
83
83
|
}
|