@venturekit/data 0.0.0-dev.20260427225816 → 0.0.0-dev.20260429114130

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/README.md +9 -5
  2. package/dist/index.d.ts +4 -3
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +14 -3
  5. package/dist/index.js.map +1 -1
  6. package/dist/migrations/dispatcher.d.ts +35 -0
  7. package/dist/migrations/dispatcher.d.ts.map +1 -0
  8. package/dist/migrations/dispatcher.js +71 -0
  9. package/dist/migrations/dispatcher.js.map +1 -0
  10. package/dist/migrations/env.d.ts +12 -0
  11. package/dist/migrations/env.d.ts.map +1 -0
  12. package/dist/migrations/env.js +12 -0
  13. package/dist/migrations/env.js.map +1 -0
  14. package/dist/migrations/errors.d.ts +33 -0
  15. package/dist/migrations/errors.d.ts.map +1 -0
  16. package/dist/migrations/errors.js +48 -0
  17. package/dist/migrations/errors.js.map +1 -0
  18. package/dist/migrations/index.d.ts +31 -10
  19. package/dist/migrations/index.d.ts.map +1 -1
  20. package/dist/migrations/index.js +33 -11
  21. package/dist/migrations/index.js.map +1 -1
  22. package/dist/migrations/runners/custom.d.ts +72 -0
  23. package/dist/migrations/runners/custom.d.ts.map +1 -0
  24. package/dist/migrations/runners/custom.js +167 -0
  25. package/dist/migrations/runners/custom.js.map +1 -0
  26. package/dist/migrations/runners/drizzle.d.ts +12 -0
  27. package/dist/migrations/runners/drizzle.d.ts.map +1 -0
  28. package/dist/migrations/runners/drizzle.js +17 -0
  29. package/dist/migrations/runners/drizzle.js.map +1 -0
  30. package/dist/migrations/runners/flyway.d.ts +14 -0
  31. package/dist/migrations/runners/flyway.d.ts.map +1 -0
  32. package/dist/migrations/runners/flyway.js +20 -0
  33. package/dist/migrations/runners/flyway.js.map +1 -0
  34. package/dist/migrations/runners/golang-migrate.d.ts +8 -0
  35. package/dist/migrations/runners/golang-migrate.d.ts.map +1 -0
  36. package/dist/migrations/runners/golang-migrate.js +13 -0
  37. package/dist/migrations/runners/golang-migrate.js.map +1 -0
  38. package/dist/migrations/runners/prisma.d.ts +10 -0
  39. package/dist/migrations/runners/prisma.d.ts.map +1 -0
  40. package/dist/migrations/runners/prisma.js +15 -0
  41. package/dist/migrations/runners/prisma.js.map +1 -0
  42. package/dist/migrations/seeds.d.ts +39 -0
  43. package/dist/migrations/seeds.d.ts.map +1 -0
  44. package/dist/migrations/seeds.js +50 -0
  45. package/dist/migrations/seeds.js.map +1 -0
  46. package/dist/migrations/types.d.ts +48 -0
  47. package/dist/migrations/types.d.ts.map +1 -0
  48. package/dist/migrations/types.js +9 -0
  49. package/dist/migrations/types.js.map +1 -0
  50. package/dist/query/index.d.ts +6 -4
  51. package/dist/query/index.d.ts.map +1 -1
  52. package/dist/query/index.js +4 -4
  53. package/dist/query/index.js.map +1 -1
  54. package/dist/query/mapper.d.ts +63 -11
  55. package/dist/query/mapper.d.ts.map +1 -1
  56. package/dist/query/mapper.js +76 -16
  57. package/dist/query/mapper.js.map +1 -1
  58. package/dist/query/pool.d.ts +15 -2
  59. package/dist/query/pool.d.ts.map +1 -1
  60. package/dist/query/pool.js +52 -2
  61. package/dist/query/pool.js.map +1 -1
  62. package/dist/query/transaction.d.ts +17 -1
  63. package/dist/query/transaction.d.ts.map +1 -1
  64. package/dist/query/transaction.js +2 -2
  65. package/dist/query/transaction.js.map +1 -1
  66. package/dist/types/migration.d.ts +11 -6
  67. package/dist/types/migration.d.ts.map +1 -1
  68. package/dist/types/migration.js +11 -6
  69. package/dist/types/migration.js.map +1 -1
  70. package/package.json +2 -2
@@ -0,0 +1,167 @@
1
+ /**
2
+ * Built-in pure-SQL migration / seed runner.
3
+ *
4
+ * Used by both `runMigrations` (when `MigrationConfig.tool === 'custom'`)
5
+ * and `runSeeds` (always). The only difference between the two callers is
6
+ * the source directory and the tracking-table name; the apply / skip /
7
+ * hash-check logic is identical.
8
+ *
9
+ * ### Tracking table
10
+ *
11
+ * Auto-created on first run with this shape:
12
+ *
13
+ * CREATE TABLE IF NOT EXISTS <table> (
14
+ * version text PRIMARY KEY,
15
+ * hash text NOT NULL,
16
+ * applied_at timestamptz NOT NULL DEFAULT now()
17
+ * )
18
+ *
19
+ * `version` is the file basename without the `.sql` extension. `hash` is a
20
+ * sha-256 of the file contents at apply time; on subsequent runs we
21
+ * compare the stored hash to the current file hash and hard-fail (via
22
+ * `MigrationHashMismatchError`) if they differ — migrations and seeds are
23
+ * immutable once applied.
24
+ *
25
+ * ### Atomicity
26
+ *
27
+ * Each pending file runs inside its own transaction with
28
+ * `statement_timeout = 0` (migrations / seeds can legitimately take
29
+ * minutes — e.g. building large indexes — and we don't want the data-
30
+ * package's default 10-second cap killing them mid-flight). On any
31
+ * exception the transaction rolls back, the tracking-row is NOT inserted,
32
+ * and the runner re-throws so the operator sees the failing file.
33
+ */
34
+ import crypto from 'node:crypto';
35
+ import { readdir, readFile } from 'node:fs/promises';
36
+ import path from 'node:path';
37
+ import { query } from '../../query/index.js';
38
+ import { beginTransaction } from '../../query/transaction.js';
39
+ import { MigrationHashMismatchError } from '../errors.js';
40
+ /**
41
+ * Apply pending `.sql` files in `opts.dir`, tracked in `opts.trackingTable`.
42
+ *
43
+ * Returns `{ applied, skipped }` — both arrays of file basenames, in
44
+ * filesystem order. A file lands in `skipped` when its tracking row
45
+ * already exists AND its current hash matches the stored hash.
46
+ *
47
+ * Throws `MigrationHashMismatchError` if any already-applied file has
48
+ * been edited.
49
+ */
50
+ export async function runSqlFiles(opts) {
51
+ validateIdentifier(opts.trackingTable);
52
+ await ensureTrackingTable(opts.trackingTable);
53
+ const files = await listSqlFiles(opts.dir);
54
+ const applied = await loadAppliedRows(opts.trackingTable);
55
+ const result = { applied: [], skipped: [] };
56
+ for (const f of files) {
57
+ const existing = applied.get(f.version);
58
+ if (existing) {
59
+ if (existing.hash !== f.hash) {
60
+ throw new MigrationHashMismatchError(f.version, existing.hash, f.hash, opts.trackingTable);
61
+ }
62
+ result.skipped.push(f.version);
63
+ continue;
64
+ }
65
+ if (opts.onApply)
66
+ opts.onApply(f.version);
67
+ await applyOne(opts.trackingTable, f.version, f.hash, f.sql);
68
+ result.applied.push(f.version);
69
+ }
70
+ return result;
71
+ }
72
+ /**
73
+ * Read-only counterpart of `runSqlFiles`. Returns one entry per `.sql` file
74
+ * in `opts.dir`, with `applied` true for files that have a matching
75
+ * tracking row.
76
+ *
77
+ * Files whose tracking row is hash-mismatched are reported with
78
+ * `applied: false` (so the operator sees them as "pending again") — this
79
+ * is a status query and shouldn't throw.
80
+ */
81
+ export async function getSqlFilesStatus(opts) {
82
+ validateIdentifier(opts.trackingTable);
83
+ await ensureTrackingTable(opts.trackingTable);
84
+ const files = await listSqlFiles(opts.dir);
85
+ const applied = await loadAppliedRows(opts.trackingTable);
86
+ return files.map((f) => {
87
+ const a = applied.get(f.version);
88
+ if (a && a.hash === f.hash) {
89
+ return { version: f.version, applied: true, appliedAt: a.appliedAt };
90
+ }
91
+ return { version: f.version, applied: false };
92
+ });
93
+ }
94
+ // ─── internals ───────────────────────────────────────────────────────────
95
+ async function listSqlFiles(dir) {
96
+ let entries;
97
+ try {
98
+ entries = await readdir(dir);
99
+ }
100
+ catch (err) {
101
+ if (err.code === 'ENOENT') {
102
+ // Empty / missing dir is a valid no-op (e.g. a project with no seeds).
103
+ return [];
104
+ }
105
+ throw err;
106
+ }
107
+ const sqlFiles = entries.filter((n) => n.endsWith('.sql')).sort();
108
+ const out = [];
109
+ for (const name of sqlFiles) {
110
+ const full = path.join(dir, name);
111
+ const sql = await readFile(full, 'utf8');
112
+ out.push({
113
+ version: name.replace(/\.sql$/, ''),
114
+ path: full,
115
+ sql,
116
+ hash: crypto.createHash('sha256').update(sql).digest('hex'),
117
+ });
118
+ }
119
+ return out;
120
+ }
121
+ async function ensureTrackingTable(table) {
122
+ await query(`CREATE TABLE IF NOT EXISTS ${table} (
123
+ version text PRIMARY KEY,
124
+ hash text NOT NULL,
125
+ applied_at timestamptz NOT NULL DEFAULT now()
126
+ )`);
127
+ }
128
+ async function loadAppliedRows(table) {
129
+ // Pin `camelCase: false` so the runner reads `applied_at` regardless of
130
+ // whatever global mapper config the consumer set on `@venturekit/data`.
131
+ // Internal bookkeeping must not be affected by application-level toggles.
132
+ const rows = await query(`SELECT version, hash, applied_at FROM ${table}`, [], undefined, { camelCase: false });
133
+ const out = new Map();
134
+ for (const r of rows) {
135
+ out.set(r.version, { hash: r.hash, appliedAt: r.applied_at });
136
+ }
137
+ return out;
138
+ }
139
+ async function applyOne(table, version, hash, sql) {
140
+ // statementTimeoutMs: 0 disables the data-package's 10s default; long
141
+ // index builds and bulk seeds shouldn't be killed mid-flight.
142
+ const tx = await beginTransaction({ statementTimeoutMs: 0 });
143
+ try {
144
+ // node-postgres lets us send multi-statement SQL in a single query call
145
+ // when no parameters are bound — exactly what a CREATE-heavy migration
146
+ // file looks like. The seed file is similarly structured.
147
+ await tx.query(sql);
148
+ await tx.query(`INSERT INTO ${table} (version, hash) VALUES ($1, $2)`, [version, hash]);
149
+ await tx.commit();
150
+ }
151
+ catch (err) {
152
+ await tx.rollback();
153
+ throw err;
154
+ }
155
+ }
156
+ /**
157
+ * Tracking-table names are interpolated directly into SQL (Postgres
158
+ * doesn't accept parameter placeholders for identifiers). Restrict to a
159
+ * conservative ASCII whitelist so injection is structurally impossible.
160
+ */
161
+ function validateIdentifier(name) {
162
+ if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(name)) {
163
+ throw new Error(`[migrate] invalid SQL identifier: '${name}'. ` +
164
+ `Tracking-table names must match /^[A-Za-z_][A-Za-z0-9_]*$/.`);
165
+ }
166
+ }
167
+ //# sourceMappingURL=custom.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom.js","sourceRoot":"","sources":["../../../src/migrations/runners/custom.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAA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AC;QACrB,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC;IAChE,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,KAAK,UAAU,QAAQ,CACrB,KAAa,EACb,OAAe,EACf,IAAY,EACZ,GAAW;IAEX,sEAAsE;IACtE,8DAA8D;IAC9D,MAAM,EAAE,GAAG,MAAM,gBAAgB,CAAC,EAAE,kBAAkB,EAAE,CAAC,EAAE,CAAC,CAAC;IAC7D,IAAI,CAAC;QACH,wEAAwE;QACxE,uEAAuE;QACvE,0DAA0D;QAC1D,MAAM,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACpB,MAAM,EAAE,CAAC,KAAK,CACZ,eAAe,KAAK,kCAAkC,EACtD,CAAC,OAAO,EAAE,IAAI,CAAC,CAChB,CAAC;QACF,MAAM,EAAE,CAAC,MAAM,EAAE,CAAC;IACpB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC;QACpB,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,SAAS,kBAAkB,CAAC,IAAY;IACtC,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAC3C,MAAM,IAAI,KAAK,CACb,sCAAsC,IAAI,KAAK;YAC7C,6DAA6D,CAChE,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Stub for `MigrationConfig.tool === 'drizzle'`.
3
+ *
4
+ * Drizzle Kit ships its own `drizzle-kit migrate` CLI that handles
5
+ * `_journal.json` + tracking tables internally. Wiring it up here would
6
+ * require synthesizing a config file, journal, and spawning the CLI — non-
7
+ * trivial work and not yet justified by demand. For now this throws so
8
+ * the dispatcher gives a clear error instead of a silent
9
+ * fallthrough.
10
+ */
11
+ export declare function drizzleNotImplemented(): never;
12
+ //# sourceMappingURL=drizzle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drizzle.d.ts","sourceRoot":"","sources":["../../../src/migrations/runners/drizzle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,wBAAgB,qBAAqB,IAAI,KAAK,CAO7C"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Stub for `MigrationConfig.tool === 'drizzle'`.
3
+ *
4
+ * Drizzle Kit ships its own `drizzle-kit migrate` CLI that handles
5
+ * `_journal.json` + tracking tables internally. Wiring it up here would
6
+ * require synthesizing a config file, journal, and spawning the CLI — non-
7
+ * trivial work and not yet justified by demand. For now this throws so
8
+ * the dispatcher gives a clear error instead of a silent
9
+ * fallthrough.
10
+ */
11
+ import { MigrationToolNotImplementedError } from '../errors.js';
12
+ export function drizzleNotImplemented() {
13
+ throw new MigrationToolNotImplementedError('drizzle', 'Run `drizzle-kit migrate` directly with your own drizzle.config.ts, ' +
14
+ "or set MigrationConfig.tool to 'custom' and ship pure-SQL files in " +
15
+ 'the migrations directory.');
16
+ }
17
+ //# sourceMappingURL=drizzle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drizzle.js","sourceRoot":"","sources":["../../../src/migrations/runners/drizzle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,gCAAgC,EAAE,MAAM,cAAc,CAAC;AAEhE,MAAM,UAAU,qBAAqB;IACnC,MAAM,IAAI,gCAAgC,CACxC,SAAS,EACT,sEAAsE;QACpE,qEAAqE;QACrE,2BAA2B,CAC9B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Stub for `MigrationConfig.tool === 'flyway'`.
3
+ *
4
+ * Flyway is a Java CLI; running it from inside `@venturekit/data` would
5
+ * require either spawning the `flyway` binary (relies on a Java install
6
+ * being available) or shipping the Flyway runtime as a peer dep. Neither
7
+ * has been wired up yet.
8
+ *
9
+ * The package already exports `getFlywayEnv(config, dbUrl)` for the
10
+ * env-only integration path — set up the env vars from that helper and
11
+ * shell out to `flyway migrate` yourself in your deploy pipeline.
12
+ */
13
+ export declare function flywayNotImplemented(): never;
14
+ //# sourceMappingURL=flyway.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flyway.d.ts","sourceRoot":"","sources":["../../../src/migrations/runners/flyway.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,wBAAgB,oBAAoB,IAAI,KAAK,CAQ5C"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Stub for `MigrationConfig.tool === 'flyway'`.
3
+ *
4
+ * Flyway is a Java CLI; running it from inside `@venturekit/data` would
5
+ * require either spawning the `flyway` binary (relies on a Java install
6
+ * being available) or shipping the Flyway runtime as a peer dep. Neither
7
+ * has been wired up yet.
8
+ *
9
+ * The package already exports `getFlywayEnv(config, dbUrl)` for the
10
+ * env-only integration path — set up the env vars from that helper and
11
+ * shell out to `flyway migrate` yourself in your deploy pipeline.
12
+ */
13
+ import { MigrationToolNotImplementedError } from '../errors.js';
14
+ export function flywayNotImplemented() {
15
+ throw new MigrationToolNotImplementedError('flyway', 'Use the `getFlywayEnv()` helper to populate FLYWAY_* env vars and ' +
16
+ 'invoke the `flyway` CLI directly in your deploy pipeline. To run ' +
17
+ 'pure-SQL migrations through `vk migrate`, set MigrationConfig.tool ' +
18
+ "to 'custom' instead.");
19
+ }
20
+ //# sourceMappingURL=flyway.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flyway.js","sourceRoot":"","sources":["../../../src/migrations/runners/flyway.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,gCAAgC,EAAE,MAAM,cAAc,CAAC;AAEhE,MAAM,UAAU,oBAAoB;IAClC,MAAM,IAAI,gCAAgC,CACxC,QAAQ,EACR,oEAAoE;QAClE,mEAAmE;QACnE,qEAAqE;QACrE,sBAAsB,CACzB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Stub for `MigrationConfig.tool === 'golang-migrate'`.
3
+ *
4
+ * `golang-migrate/migrate` is a Go CLI; integrating it would mean
5
+ * spawning the binary and parsing its output. Not yet wired up.
6
+ */
7
+ export declare function golangMigrateNotImplemented(): never;
8
+ //# sourceMappingURL=golang-migrate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"golang-migrate.d.ts","sourceRoot":"","sources":["../../../src/migrations/runners/golang-migrate.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,wBAAgB,2BAA2B,IAAI,KAAK,CAOnD"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Stub for `MigrationConfig.tool === 'golang-migrate'`.
3
+ *
4
+ * `golang-migrate/migrate` is a Go CLI; integrating it would mean
5
+ * spawning the binary and parsing its output. Not yet wired up.
6
+ */
7
+ import { MigrationToolNotImplementedError } from '../errors.js';
8
+ export function golangMigrateNotImplemented() {
9
+ throw new MigrationToolNotImplementedError('golang-migrate', 'Invoke the `migrate` CLI directly from your deploy pipeline, or set ' +
10
+ "MigrationConfig.tool to 'custom' to run pure-SQL files through " +
11
+ 'the bundled VentureKit runner.');
12
+ }
13
+ //# sourceMappingURL=golang-migrate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"golang-migrate.js","sourceRoot":"","sources":["../../../src/migrations/runners/golang-migrate.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,gCAAgC,EAAE,MAAM,cAAc,CAAC;AAEhE,MAAM,UAAU,2BAA2B;IACzC,MAAM,IAAI,gCAAgC,CACxC,gBAAgB,EAChB,sEAAsE;QACpE,iEAAiE;QACjE,gCAAgC,CACnC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Stub for `MigrationConfig.tool === 'prisma'`.
3
+ *
4
+ * Prisma Migrate is part of the Prisma toolchain and assumes a
5
+ * `schema.prisma` + `prisma migrate` workflow. It doesn't make sense to
6
+ * adopt it inside `@venturekit/data` without first depending on Prisma
7
+ * itself. Not yet wired up.
8
+ */
9
+ export declare function prismaNotImplemented(): never;
10
+ //# sourceMappingURL=prisma.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prisma.d.ts","sourceRoot":"","sources":["../../../src/migrations/runners/prisma.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,wBAAgB,oBAAoB,IAAI,KAAK,CAO5C"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Stub for `MigrationConfig.tool === 'prisma'`.
3
+ *
4
+ * Prisma Migrate is part of the Prisma toolchain and assumes a
5
+ * `schema.prisma` + `prisma migrate` workflow. It doesn't make sense to
6
+ * adopt it inside `@venturekit/data` without first depending on Prisma
7
+ * itself. Not yet wired up.
8
+ */
9
+ import { MigrationToolNotImplementedError } from '../errors.js';
10
+ export function prismaNotImplemented() {
11
+ throw new MigrationToolNotImplementedError('prisma', 'Run `prisma migrate` directly from your project, or set ' +
12
+ "MigrationConfig.tool to 'custom' to run pure-SQL files through " +
13
+ 'the bundled VentureKit runner.');
14
+ }
15
+ //# sourceMappingURL=prisma.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prisma.js","sourceRoot":"","sources":["../../../src/migrations/runners/prisma.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,gCAAgC,EAAE,MAAM,cAAc,CAAC;AAEhE,MAAM,UAAU,oBAAoB;IAClC,MAAM,IAAI,gCAAgC,CACxC,QAAQ,EACR,0DAA0D;QACxD,iEAAiE;QACjE,gCAAgC,CACnC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Seed runner — applies pure-SQL files from a `db/seeds/` directory,
3
+ * tracked in `__vk_seeds`.
4
+ *
5
+ * Seeds and migrations share the same runner core (`runSqlFiles` from
6
+ * `runners/custom.ts`) — the only differences are:
7
+ *
8
+ * - Source directory: `db/seeds/` vs `db/migrations/`
9
+ * - Tracking table: `__vk_seeds` vs `__vk_migrations`
10
+ * - Dispatch path: always the VK runner vs `MigrationConfig.tool`
11
+ *
12
+ * Seed files are strict literal SQL. There is **no `${VAR}` interpolation**
13
+ * — operators bake values directly into the file (forking projects edit
14
+ * the SQL once before first deploy, then manage subsequent changes through
15
+ * their app's UI). This avoids an entire class of injection / escaping
16
+ * concerns and keeps the seed runner as small as the migration runner.
17
+ *
18
+ * Like migrations, seeds are run-once-and-tracked. Editing an already-
19
+ * applied seed file fails loudly with `MigrationHashMismatchError`.
20
+ */
21
+ import type { RunResult, SeedRunOptions, StatusEntry } from './types.js';
22
+ /** Tracking-table name for seeds. Mirrors `__vk_migrations` for migrations. */
23
+ export declare const SEEDS_TRACKING_TABLE = "__vk_seeds";
24
+ /**
25
+ * Apply pending seed files in `opts.seedsDir`. Returns `{ applied, skipped }`
26
+ * — basenames of files in filesystem order.
27
+ *
28
+ * Idempotent: re-running with no new files is a no-op (everything goes
29
+ * into `skipped`). Throws `MigrationHashMismatchError` if any already-
30
+ * applied file has been edited.
31
+ */
32
+ export declare function runSeeds(opts: SeedRunOptions): Promise<RunResult>;
33
+ /**
34
+ * Read-only status query: one `StatusEntry` per `.sql` file in
35
+ * `opts.seedsDir`, with `applied: true` when a tracking row exists AND the
36
+ * file hash still matches.
37
+ */
38
+ export declare function getSeedStatus(opts: SeedRunOptions): Promise<StatusEntry[]>;
39
+ //# sourceMappingURL=seeds.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"seeds.d.ts","sourceRoot":"","sources":["../../src/migrations/seeds.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzE,+EAA+E;AAC/E,eAAO,MAAM,oBAAoB,eAAe,CAAC;AAEjD;;;;;;;GAOG;AACH,wBAAsB,QAAQ,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,SAAS,CAAC,CAMvE;AAED;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAKhF"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Seed runner — applies pure-SQL files from a `db/seeds/` directory,
3
+ * tracked in `__vk_seeds`.
4
+ *
5
+ * Seeds and migrations share the same runner core (`runSqlFiles` from
6
+ * `runners/custom.ts`) — the only differences are:
7
+ *
8
+ * - Source directory: `db/seeds/` vs `db/migrations/`
9
+ * - Tracking table: `__vk_seeds` vs `__vk_migrations`
10
+ * - Dispatch path: always the VK runner vs `MigrationConfig.tool`
11
+ *
12
+ * Seed files are strict literal SQL. There is **no `${VAR}` interpolation**
13
+ * — operators bake values directly into the file (forking projects edit
14
+ * the SQL once before first deploy, then manage subsequent changes through
15
+ * their app's UI). This avoids an entire class of injection / escaping
16
+ * concerns and keeps the seed runner as small as the migration runner.
17
+ *
18
+ * Like migrations, seeds are run-once-and-tracked. Editing an already-
19
+ * applied seed file fails loudly with `MigrationHashMismatchError`.
20
+ */
21
+ import { runSqlFiles, getSqlFilesStatus } from './runners/custom.js';
22
+ /** Tracking-table name for seeds. Mirrors `__vk_migrations` for migrations. */
23
+ export const SEEDS_TRACKING_TABLE = '__vk_seeds';
24
+ /**
25
+ * Apply pending seed files in `opts.seedsDir`. Returns `{ applied, skipped }`
26
+ * — basenames of files in filesystem order.
27
+ *
28
+ * Idempotent: re-running with no new files is a no-op (everything goes
29
+ * into `skipped`). Throws `MigrationHashMismatchError` if any already-
30
+ * applied file has been edited.
31
+ */
32
+ export async function runSeeds(opts) {
33
+ return runSqlFiles({
34
+ dir: opts.seedsDir,
35
+ trackingTable: SEEDS_TRACKING_TABLE,
36
+ onApply: opts.onApply,
37
+ });
38
+ }
39
+ /**
40
+ * Read-only status query: one `StatusEntry` per `.sql` file in
41
+ * `opts.seedsDir`, with `applied: true` when a tracking row exists AND the
42
+ * file hash still matches.
43
+ */
44
+ export async function getSeedStatus(opts) {
45
+ return getSqlFilesStatus({
46
+ dir: opts.seedsDir,
47
+ trackingTable: SEEDS_TRACKING_TABLE,
48
+ });
49
+ }
50
+ //# sourceMappingURL=seeds.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"seeds.js","sourceRoot":"","sources":["../../src/migrations/seeds.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGrE,+EAA+E;AAC/E,MAAM,CAAC,MAAM,oBAAoB,GAAG,YAAY,CAAC;AAEjD;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,IAAoB;IACjD,OAAO,WAAW,CAAC;QACjB,GAAG,EAAE,IAAI,CAAC,QAAQ;QAClB,aAAa,EAAE,oBAAoB;QACnC,OAAO,EAAE,IAAI,CAAC,OAAO;KACtB,CAAC,CAAC;AACL,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,IAAoB;IACtD,OAAO,iBAAiB,CAAC;QACvB,GAAG,EAAE,IAAI,CAAC,QAAQ;QAClB,aAAa,EAAE,oBAAoB;KACpC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Types for the migration / seed runners.
3
+ *
4
+ * NOTE: `MigrationConfig` (the project-level config shape with the
5
+ * `tool` enum) lives in `../types/migration.ts`. This file only contains
6
+ * the input/output shapes for the runner functions themselves.
7
+ */
8
+ /**
9
+ * Result of a single `runMigrations` / `runSeeds` invocation.
10
+ *
11
+ * `applied` and `skipped` are file basenames (without `.sql`), in the
12
+ * order they appeared on disk. A file is `skipped` when its tracking-table
13
+ * row already exists AND its hash still matches what was applied.
14
+ */
15
+ export interface RunResult {
16
+ applied: string[];
17
+ skipped: string[];
18
+ }
19
+ /**
20
+ * Per-file status reported by `getMigrationStatus` / `getSeedStatus`.
21
+ */
22
+ export interface StatusEntry {
23
+ /** File basename without `.sql`, e.g. `0000_init`. */
24
+ version: string;
25
+ /** True if a tracking row exists AND the file hash still matches. */
26
+ applied: boolean;
27
+ /** Set when `applied` is true. */
28
+ appliedAt?: Date;
29
+ }
30
+ /**
31
+ * Optional knobs shared by `runMigrations` and `runSeeds`.
32
+ */
33
+ export interface RunOptions {
34
+ /**
35
+ * Called immediately before each pending file is applied. Useful for
36
+ * streaming progress to stdout from the CLI without coupling the runner
37
+ * to a logging library.
38
+ */
39
+ onApply?: (version: string) => void;
40
+ }
41
+ /**
42
+ * Input for `runSeeds` / `getSeedStatus`.
43
+ */
44
+ export interface SeedRunOptions extends RunOptions {
45
+ /** Directory containing seed `.sql` files. */
46
+ seedsDir: string;
47
+ }
48
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/migrations/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;GAMG;AACH,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,sDAAsD;IACtD,OAAO,EAAE,MAAM,CAAC;IAChB,qEAAqE;IACrE,OAAO,EAAE,OAAO,CAAC;IACjB,kCAAkC;IAClC,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC;AAED;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,UAAU;IAChD,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,CAAC;CAClB"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Types for the migration / seed runners.
3
+ *
4
+ * NOTE: `MigrationConfig` (the project-level config shape with the
5
+ * `tool` enum) lives in `../types/migration.ts`. This file only contains
6
+ * the input/output shapes for the runner functions themselves.
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/migrations/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -44,11 +44,13 @@
44
44
  * - An empty result set is **not** an error — it returns `[]` (or whatever
45
45
  * your mapper produces for an empty array).
46
46
  */
47
+ import { type MapperOptions } from './mapper.js';
47
48
  import type { ResultsMapper } from './transaction.js';
48
- export { getPool } from './pool.js';
49
- export { mapResults, mapRow } from './mapper.js';
49
+ export { getPool, applyDatabaseUrlToEnv } from './pool.js';
50
+ export { mapResults, mapRow, configureMapper, getMapperConfig, } from './mapper.js';
51
+ export type { MapperOptions } from './mapper.js';
50
52
  export { beginTransaction, withTransaction, buildTransaction, } from './transaction.js';
51
- export type { Transaction, ResultsMapper } from './transaction.js';
53
+ export type { Transaction, ResultsMapper, Querier } from './transaction.js';
52
54
  /**
53
55
  * Execute a SQL query against the connection pool.
54
56
  *
@@ -83,5 +85,5 @@ export type { Transaction, ResultsMapper } from './transaction.js';
83
85
  * );
84
86
  * ```
85
87
  */
86
- export declare function query<T = Record<string, unknown>[]>(sqlQuery: string, queryParams?: unknown[], resultsMapper?: ResultsMapper<T>): Promise<T>;
88
+ export declare function query<T = Record<string, unknown>[]>(sqlQuery: string, queryParams?: unknown[], resultsMapper?: ResultsMapper<T>, mapperOptions?: MapperOptions): Promise<T>;
87
89
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/query/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAk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AC,MAAM,EAAE,OAAO,CAAC,EAAE,EACvD,QAAQ,EAAE,MAAM,EAChB,WAAW,CAAC,EAAE,OAAO,EAAE,EACvB,aAAa,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,EAChC,aAAa,CAAC,EAAE,aAAa,GAC5B,OAAO,CAAC,CAAC,CAAC,CAKZ"}
@@ -46,8 +46,8 @@
46
46
  */
47
47
  import { getPool } from './pool.js';
48
48
  import { mapResults } from './mapper.js';
49
- export { getPool } from './pool.js';
50
- export { mapResults, mapRow } from './mapper.js';
49
+ export { getPool, applyDatabaseUrlToEnv } from './pool.js';
50
+ export { mapResults, mapRow, configureMapper, getMapperConfig, } from './mapper.js';
51
51
  export { beginTransaction, withTransaction, buildTransaction, } from './transaction.js';
52
52
  /**
53
53
  * Execute a SQL query against the connection pool.
@@ -83,10 +83,10 @@ export { beginTransaction, withTransaction, buildTransaction, } from './transact
83
83
  * );
84
84
  * ```
85
85
  */
86
- export async function query(sqlQuery, queryParams, resultsMapper) {
86
+ export async function query(sqlQuery, queryParams, resultsMapper, mapperOptions) {
87
87
  const pool = getPool();
88
88
  const res = await pool.query(sqlQuery, queryParams);
89
- const mapped = mapResults(res.rows);
89
+ const mapped = mapResults(res.rows, mapperOptions);
90
90
  return resultsMapper ? resultsMapper(mapped) : mapped;
91
91
  }
92
92
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/query/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAU,MAAM,aAAa,CAAC;AAGjD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EACL,gBAAgB,EAChB,eAAe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