durable-db 0.12.0 → 0.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -264,7 +264,7 @@ Invoice.toJsonSchema(); // JSON Schema (2020-12 or draft-07)
264
264
  Invoice['~standard']; // a Standard Schema, with its JSON Schema converter
265
265
  ```
266
266
 
267
- It has ArkType's keywords (`string.email`, `string.uuid`, `number.integer`, `string.numeric.parse`, `string.date.iso.parse`, …), bounds (`'string > 0'`, `'0 < number <= 10'`, `'number % 2'`), unions, intersections, literals, regexes, arrays, tuples (`['string', 'number?']`, `['string', '...', 'number[]']`), `Record<K, V>`, object keys (`'key?'`, `'[string]'`, `'+'`, `'...'`), defaults (`'number = 0'`), tuple expressions (`'[]'`, `'|'`, `'&'`, `'=>'`, `':'`, `'|>'`, `'@'`, `'==='`, `'instanceof'`, `'keyof'`) and a Type's methods (`array`, `or`, `and`, `merge`, `pick`, `omit`, `partial`, `required`, `keyof`, `get`, `optional`, `default`, `narrow`, `pipe`, `to`, `describe`, `configure`, `brand`, `onUndeclaredKey`, `props`, `assert`, `allows`, `from`, `toJsonSchema`). ArkType's scopes, generics, `match` and `fn` are not there: a definition it does not know fails with a `ParseError` naming it, never a validator that checks something else. `tests/type/conformance.test.ts` runs every supported definition through both against the same values. A Type of `durable-db/type` nests in ArkType's own definitions and the other way round.
267
+ It has ArkType's keywords (`string.email`, `string.uuid`, `number.integer`, `string.numeric.parse`, `string.date.iso.parse`, …), bounds (`'string > 0'`, `'0 < number <= 10'`, `'number % 2'`), unions, intersections, literals, regexes, arrays, tuples (`['string', 'number?']`, `['string', '...', 'number[]']`), `Record<K, V>`, object keys (`'key?'`, `'[string]'`, `'+'`, `'...'`), defaults (`'number = 0'`), tuple expressions (`'[]'`, `'|'`, `'&'`, `'=>'`, `':'`, `'|>'`, `'@'`, `'==='`, `'instanceof'`, `'keyof'`) and a Type's methods (`array`, `or`, `and`, `merge`, `pick`, `omit`, `partial`, `required`, `keyof`, `get`, `optional`, `default`, `narrow`, `pipe`, `to`, `describe`, `configure`, `brand`, `onUndeclaredKey`, `props`, `assert`, `allows`, `from`, `toJsonSchema`). ArkType's scopes, generics, `match` and `fn` are not there: a definition it does not know fails with a `ParseError` naming it, never a validator that checks something else. `tests/type/conformance.test.ts` runs every supported definition through both against the same values. One difference is on purpose: a JSON Schema lists an object's `properties` in the order the keys were declared, where ArkType sorts them (its `required` list stays sorted). A Type of `durable-db/type` nests in ArkType's own definitions and the other way round.
268
268
 
269
269
  ### The `handler` function
270
270
 
@@ -455,21 +455,28 @@ db generate --database main add_posts_table
455
455
  | `--database <db>` | Only generate for this specific database |
456
456
  | `--rename <table.old=new>` | Answer a rename question without a prompt (repeatable). See [Renames](#renames) |
457
457
  | `--no-renames` | Answer every remaining rename question with "create" (the old column/table is dropped) |
458
- | `--force` | Write the migration even when a statement fails on every table that has rows |
458
+ | `--force` | Write the migration even when it is not safe on a database that has rows (`db validate` still refuses it) |
459
459
 
460
460
  **What it does:**
461
461
 
462
462
  1. Compares your current Drizzle schema against the production snapshot (`_snapshot.json`)
463
463
  2. Generates SQL statements for the diff (asking about renames — see [Renames](#renames))
464
- 3. Checks what they do to a database that has rows (below) — before any file is written
464
+ 3. Checks what they do to a database that has rows (below): reads the schema change, then replays the migration on rows — before any file is written
465
465
  4. Writes a timestamped `.sql` file to the configured `migrationsDir`
466
466
  5. Updates the production snapshot with a new ID and `prevId` chain
467
467
  6. Clears dev state for this database (the dev migrations are now superseded by the production migration)
468
468
 
469
- **Unsafe statements.** Per-tenant databases migrate lazily, on each tenant's first request after a deploy — so a statement that only fails on a table with rows surfaces in production, once per tenant with data, and that tenant's database stays broken until a fixed migration ships. `db validate` cannot catch it: it replays the migrations on an empty database. So `generate`:
469
+ **Unsafe statements.** Per-tenant databases migrate lazily, on each tenant's first request after a deploy — so a statement that only fails on a table with rows surfaces in production, once per tenant with data, and that tenant's database stays broken until a fixed migration ships. Nobody can look into every tenant's database first, so a migration has to pass on **any rows the schema before it allows**. `generate` checks that twice, and writes nothing when it does not hold:
470
470
 
471
- - **refuses** (exit code 1, nothing written) a column added `NOT NULL` without a default: `products.currency is added NOT NULL without a default — the migration fails on every table that has rows: add .default(...) or add it nullable and backfill`. `--force` writes it anyway (a table known to be empty everywhere). See [Adding a required column](#adding-a-required-column);
472
- - **warns** (`⚠`) when a column or table is dropped (its data is lost) or a column becomes `NOT NULL` (fails where a row holds `NULL`).
471
+ - It **reads the schema change**: a column added `NOT NULL` without a default is refused (`products.currency is added NOT NULL without a default — the migration fails on every table that has rows: add .default(...) or add it nullable and backfill`; see [Adding a required column](#adding-a-required-column)); a dropped column or table, a column made `NOT NULL` and a foreign key added to a table that exists are warned about (`⚠`).
472
+ - It **replays the migration on a database that has rows** (see [On a database that has rows](#on-a-database-that-has-rows)) and refuses one that fails there, or takes rows or values along:
473
+
474
+ ```
475
+ Refusing to write a migration that is not safe on a database that has rows:
476
+ main: it fails on a database that has rows — FOREIGN KEY constraint failed (chunk 0, statement 2: INSERT INTO `__new_cart_items`…): a row references a row that is not there — remove or repair those rows in this migration, before the statement: DELETE FROM … WHERE … NOT IN (SELECT …)
477
+ ```
478
+
479
+ `--force` writes the migration anyway — for one you are about to repair by hand (add the `UPDATE` or `DELETE` before the statement that fails), or for tables known to be empty everywhere. Writing is not accepting: `db validate` refuses it until the migration passes on rows or the finding is accepted there.
473
480
 
474
481
  **Output example:**
475
482
 
@@ -583,6 +590,8 @@ db validate --verbose
583
590
  |------|-------------|
584
591
  | `--database <db>` | Only validate this specific database |
585
592
  | `--no-dev` | Skip dev migrations, only validate production migrations |
593
+ | `--no-rows` | Skip the replay on a database that has rows |
594
+ | `--accept` | Record what the replay on rows finds in the production migrations as looked at and let through |
586
595
 
587
596
  **What it does:**
588
597
 
@@ -591,9 +600,8 @@ db validate --verbose
591
600
  3. Builds the expected schema separately from the Drizzle definition
592
601
  4. Compares the migrated schema against the expected schema to detect drift
593
602
  5. Reports SQL errors, foreign key violations, or schema mismatches
594
- 6. Warns (`⚠ not yet generated: …`) about what the schema change `db generate` has not written yet would do to a database that has rows — the checks `generate` applies (a `NOT NULL` column without a default, dropped columns and tables, names that may be renames)
595
-
596
- The replay runs on an **empty** database, so it proves a migration is valid SQL, not that it succeeds on a table with rows. Committed migrations are not re-checked for that: validate cannot know which of them already ran where.
603
+ 6. Replays the migrations once more **on a database that has rows** ([below](#on-a-database-that-has-rows)): a production migration that fails there, or takes rows or values along, is an error
604
+ 7. Warns (`⚠ not yet generated: …`) about what the schema change `db generate` has not written yet would do to a database that has rows — the checks `generate` applies (a `NOT NULL` column without a default, dropped columns and tables, names that may be renames), and what a dev migration does on rows
597
605
 
598
606
  **Output example (success):**
599
607
 
@@ -609,6 +617,11 @@ The replay runs on an **empty** database, so it proves a migration is valid SQL,
609
617
  ✗ 20240315123045_bad[0]: near "INVALID": syntax error
610
618
  ```
611
619
 
620
+ ```
621
+ ✗ main: 5 migration(s)
622
+ ✗ 20240315123045_sku: fails on a database that has rows — NOT NULL constraint failed: __new_products.sku (chunk 0, statement 2: INSERT INTO `__new_products`…): a row holds NULL there — give those rows a value in this migration, before the statement: UPDATE … SET … WHERE … IS NULL
623
+ ```
624
+
612
625
  Schema drift (migrations ran cleanly but produce a different schema than your Drizzle definition) is reported as:
613
626
 
614
627
  ```
@@ -625,7 +638,9 @@ Schema drift (migrations ran cleanly but produce a different schema than your Dr
625
638
 
626
639
  ### Renames
627
640
 
628
- drizzle-kit cannot tell a renamed column (or table) from a dropped one plus a new one. When a table has both a new and a vanished column — or the schema both a new and a vanished table — its diff asks:
641
+ drizzle-kit cannot tell a renamed column (or table) from a dropped one plus a new one. durable-db can, where there is one way to read it: **a table that lost exactly one column and gained exactly one declared the same way** — type, nullability, default, everything but the name — **was renamed**, and so was a table that is gone while a new one has its columns. `push` and `generate` write the rename (`` ALTER TABLE `users` RENAME COLUMN "bio" TO "about"; ``) without asking, in a terminal or not, and the data is kept. Taking it for a drop and a create would lose the data for a change nobody made; `--no-renames` says that is what you meant.
642
+
643
+ What is left is a real question — two new names for one that is gone, or a column that changed in more than its name. There drizzle-kit's diff asks:
629
644
 
630
645
  ```
631
646
  Is about column in users table created or renamed from another column?
@@ -721,6 +736,39 @@ Each chunk is tracked independently in the `__migrations` table. If a Durable Ob
721
736
 
722
737
  Concurrent first calls to a Durable Object share one migration run: requests that arrive while it migrates wait for it instead of applying the same statements again.
723
738
 
739
+ ### On a database that has rows
740
+
741
+ A migration replayed on an empty database proves it is valid SQL. What goes wrong in production goes wrong on rows — and every tenant's database migrates on its own, after the deploy, where nobody is watching. So `db generate` and `db validate` replay each migration a second time, on a database filled with rows that are valid for the schema as it was and as unkind as that schema lets them be:
742
+
743
+ - every nullable column `NULL` in one row — a column made `NOT NULL` fails;
744
+ - the same values in two rows wherever nothing says they are unique — a new unique index fails;
745
+ - values no other table has in columns no foreign key ties down — a new foreign key fails;
746
+ - rows in every table that references another — a rebuild that takes them along shows.
747
+
748
+ It runs as a Durable Object runs a migration: foreign keys on and staying on (`PRAGMA foreign_keys=OFF` does nothing there, which is why a rebuild that adds a foreign key fails in production and passes anywhere else), each chunk in a transaction, the rows that reference a rebuilt table kept through its `DROP`.
749
+
750
+ What it reports, per migration:
751
+
752
+ | Finding | Meaning |
753
+ |---------|---------|
754
+ | `fails on a database that has rows — …` | A statement failed: the SQLite error, the statement, and what to do |
755
+ | `N of the M rows of <table> are gone after it` | Rows are lost and no statement of the migration deletes them |
756
+ | `<table>.<column> is empty after it in N row(s)` | A rebuild did not copy a column that is still there |
757
+
758
+ A rename keeps its rows and values under the new name, and is no finding. A `DELETE FROM` or `UPDATE` written into the migration is its author's: rows it removes and values it changes are not reported.
759
+
760
+ **The fix is in the migration.** Make the rows fit before the statement that needs them to:
761
+
762
+ ```sql
763
+ UPDATE `products` SET `sku` = '' WHERE `sku` IS NULL;
764
+
765
+ --> breakpoint
766
+
767
+ -- … the rebuild that makes sku NOT NULL
768
+ ```
769
+
770
+ Then `db validate` passes. Where a finding cannot happen — the migration already ran everywhere, or the rows it fails on cannot exist — accept it: `db validate --accept` writes it to `_accepted.json` next to the snapshot (by migration and finding, so a new finding in the same migration is still an error, and the file shows in review what was let through). A table no row could be made for (a `CHECK` the made-up values do not meet) is said, and not checked.
771
+
724
772
  ### Adding a required column
725
773
 
726
774
  SQLite rejects `ALTER TABLE … ADD … NOT NULL` without a default on a table that has rows (`Cannot add a NOT NULL column with default value NULL`), and every tenant's database migrates on its own, after the deploy. So `db generate` refuses such a column (see [Unsafe statements](#db-generate)). Either:
@@ -1241,7 +1289,7 @@ related('customers', 'invoices', {
1241
1289
  });
1242
1290
  ```
1243
1291
 
1244
- **Filtering.** `where` says which rows of a `many` to read — a condition on the related table, written with Kysely's expression builder and typed from the schema. It applies before `limit`, and its values are bound like those of any condition:
1292
+ **Filtering.** `where` says which rows of a relation to read — a condition on the related table, written with Kysely's expression builder and typed from the schema. On a `many` it applies before `limit`. On a `one` it says whether the row the foreign key leads to is read at all: where it does not hold the relation answers `null`, also for a foreign key that is never null — and the type says so (`related('invoices', 'customer', { columns: ['name'], where: (eb) => eb('vip', '=', true) })` is `{ name: string } | null`). Its values are bound like those of any condition:
1245
1293
 
1246
1294
  ```ts
1247
1295
  related('invoices', 'invoiceLines', {
@@ -1,4 +1,4 @@
1
- import { t as createTypeParser } from "./type-CUgZsZp3.js";
1
+ import { t as createTypeParser } from "./type-pAQ37iEL.js";
2
2
  //#region src/db/actionArgs.ts
3
3
  /**
4
4
  * `type` (durable-db/type: ArkType's definitions and types), for an
package/dist/cli/bin.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { n as registerDbCommands } from "../cli-CRZWralu.js";
2
+ import { n as registerDbCommands } from "../cli--9cKeEka.js";
3
3
  import { Command } from "commander";
4
4
  //#region src/cli/bin.ts
5
5
  const program = new Command();
@@ -1,7 +1,7 @@
1
1
  import { t as DatabaseSource } from "../discovery-gHeLq8jk.js";
2
- import { S as parseRenameSpec, g as SchemaRenameRequiredError, h as SchemaAmbiguity, m as RenameAnswer, n as Snapshot, t as MigrationResolution, u as MigrationRisk } from "../snapshot-RFLfeZGw.js";
3
- import { l as DatabaseInfo } from "../defineDatabase-BE7YRtLh.js";
4
- import "../index-CUkSkt7G.js";
2
+ import { C as parseRenameSpec, g as SchemaRenameRequiredError, h as SchemaAmbiguity, m as RenameAnswer, n as Snapshot, t as MigrationResolution, u as MigrationRisk } from "../snapshot-D3_SNABU.js";
3
+ import { l as DatabaseInfo } from "../defineDatabase-DlgYfwhP.js";
4
+ import "../index-B5W4m0Dq.js";
5
5
  import { Command } from "commander";
6
6
  import "vite";
7
7
  import "@babel/types";
@@ -254,6 +254,67 @@ export declare function push(ctx?: PushContext): Promise<PushResult[]>;
254
254
  */
255
255
  export declare function pushOne(ctx: PushContext | undefined, dbName: string): Promise<PushResult | null>;
256
256
  //#endregion
257
+ //#region src/migrations/withRows.d.ts
258
+ /** The part of libsql's (better-sqlite3's) API the replay uses. */
259
+ interface RowsDatabase {
260
+ exec(sql: string): void;
261
+ prepare(sql: string): {
262
+ all(...params: unknown[]): unknown[];
263
+ run(...params: unknown[]): unknown;
264
+ };
265
+ close(): void;
266
+ }
267
+ type RowsDatabaseConstructor = new (filename: string) => RowsDatabase;
268
+ type RowsFindingKind = 'fails' | 'loses-rows' | 'loses-values';
269
+ /** What a migration does to a database that has rows, and should not. */
270
+ interface RowsFinding {
271
+ migration: string;
272
+ kind: RowsFindingKind;
273
+ table?: string;
274
+ column?: string;
275
+ /** Of a failure: the chunk and the statement that failed, and what SQLite said. */
276
+ chunk?: number;
277
+ statement?: string;
278
+ error?: string;
279
+ message: string;
280
+ /** Names the finding from one run to the next: what an acceptance is recorded by. */
281
+ fingerprint: string;
282
+ }
283
+ interface RowsReplay {
284
+ findings: RowsFinding[];
285
+ /** Tables no row could be made for (a CHECK the made-up values do not meet, say): not checked against rows. */
286
+ unseeded: {
287
+ table: string;
288
+ reason: string;
289
+ }[];
290
+ /** A migration that fails on an empty database too: the replay stopped there. */
291
+ stopped?: {
292
+ migration: string;
293
+ error: string;
294
+ };
295
+ }
296
+ /**
297
+ * Replays `migrations`, in order, on a database with rows: before each one,
298
+ * every table gets rows its schema allows; then the migration runs as a
299
+ * Durable Object would run it. What fails, and what takes rows or values
300
+ * along without saying so, is a finding. A migration that fails is run again
301
+ * on the emptied database, so the ones after it are still checked.
302
+ */
303
+ export declare function replayWithRows(Database: RowsDatabaseConstructor, migrations: readonly (readonly [name: string, chunks: string[][]])[]): RowsReplay;
304
+ /** `<migrations>/<database>/_accepted.json`: the findings someone has looked at and let through, by migration. */
305
+ type Accepted = Record<string, string[]>;
306
+ export declare const ACCEPTED_FILE = "_accepted.json";
307
+ /** The findings nobody has accepted, and the ones somebody has. */
308
+ export declare function sift(findings: RowsFinding[], accepted: Accepted): {
309
+ open: RowsFinding[];
310
+ accepted: RowsFinding[];
311
+ };
312
+ /** `accepted` with these findings added. */
313
+ export declare function accept(accepted: Accepted, findings: RowsFinding[]): Accepted;
314
+ /** The acceptances of a database's migrations; none where the file is not there (or cannot be read as one). */
315
+ export declare function readAccepted(migrationsDir: string): Accepted;
316
+ export declare function writeAccepted(migrationsDir: string, accepted: Accepted): void;
317
+ //#endregion
257
318
  //#region src/cli/generate.d.ts
258
319
  interface GenerateContext {
259
320
  projectRoot?: string;
@@ -267,9 +328,12 @@ interface GenerateOptions extends RenameResolutionOptions {
267
328
  /** Only generate for this database (an unknown name throws UnknownDatabaseError) */
268
329
  database?: string;
269
330
  /**
270
- * Write the migration even when a statement fails on every table that has
271
- * rows (a NOT NULL column without a default) — e.g. a table known to be
272
- * empty in every tenant.
331
+ * Write the migration even when it is not safe on a database that has rows
332
+ * — a statement that fails on every table with rows (a NOT NULL column
333
+ * without a default), or what the replay on rows finds (a foreign key over
334
+ * rows that reference nothing, a unique index over rows that repeat).
335
+ * Writing is not accepting: `db validate` still refuses it, until the
336
+ * migration repairs the rows or the finding is accepted there.
273
337
  */
274
338
  force?: boolean;
275
339
  }
@@ -301,6 +365,20 @@ export declare class UnsafeMigrationError extends Error {
301
365
  database: string;
302
366
  }>);
303
367
  }
368
+ /**
369
+ * `db generate` refuses a migration that is not safe on a database that has
370
+ * rows: one the replay on rows (migrations/withRows.ts) sees fail, or take
371
+ * rows or values along. Nothing is written — unless `force`, for a migration
372
+ * that is going to be repaired by hand before it ships.
373
+ */
374
+ export declare class MigrationFailsOnRowsError extends Error {
375
+ readonly findings: Array<RowsFinding & {
376
+ database: string;
377
+ }>;
378
+ constructor(findings: Array<RowsFinding & {
379
+ database: string;
380
+ }>);
381
+ }
304
382
  /**
305
383
  * Generate production migrations from schema changes
306
384
  *
@@ -457,12 +535,26 @@ interface ValidateContext {
457
535
  noDev?: boolean;
458
536
  /** Only validate this database */
459
537
  database?: string;
538
+ /**
539
+ * Skip the replay on a database that has rows (default: it runs). The
540
+ * replay on an empty one proves the SQL; this one, that it passes on data.
541
+ */
542
+ rows?: boolean;
543
+ /**
544
+ * Record what the replay on rows finds in the production migrations as
545
+ * looked at and let through (`_accepted.json` next to the snapshot): for
546
+ * migrations that already ran everywhere, and for a failure that cannot
547
+ * happen on the data there is.
548
+ */
549
+ accept?: boolean;
460
550
  }
461
551
  interface ValidateError {
462
552
  migration: string;
463
553
  chunk: number;
464
554
  statement: string;
465
555
  error: string;
556
+ /** Found by the replay on a database that has rows: the SQL is valid, the migration is not safe. */
557
+ rows?: RowsFinding;
466
558
  }
467
559
  interface ValidateResult {
468
560
  database: string;
@@ -480,6 +572,14 @@ interface ValidateResult {
480
572
  * database and cannot know which committed migrations already ran where.
481
573
  */
482
574
  pendingWarnings: string[];
575
+ /**
576
+ * What the replay on a database that has rows found and somebody accepted
577
+ * (`_accepted.json`), what it found in dev migrations (`db generate` will
578
+ * refuse those), and the tables it could make no row for. What it found in
579
+ * production migrations and nobody accepted is in `errors`, and makes
580
+ * `migrationsValid` false.
581
+ */
582
+ rowsWarnings: string[];
483
583
  }
484
584
  /**
485
585
  * Dry-run all migrations against a local in-memory SQLite to catch errors
@@ -495,4 +595,4 @@ export declare function validate(ctx?: ValidateContext): Promise<ValidateResult[
495
595
  */
496
596
  export declare function declaresSchema(db: Pick<DatabaseInfo, 'schemaExport' | 'schemaTableNames'>): boolean;
497
597
  //#endregion
498
- export { type DatabaseDevState, type DatabaseDiff, type DatabaseSource, type DatabaseStatus, type DbCommandDefaults, type DevPaths, type DevServerLock, type DevState, type DiffResult, type DiscoverOptions, type GenerateContext, type GenerateOptions, type GenerateResult, type MigrationRisk, type PushContext, type PushResult, type RenameAnswer, type RenameResolutionOptions, type ResetContext, type ResetOptions, type ResetResult, type SchemaAmbiguity, SchemaRenameRequiredError, type StatusContext, type StatusResult, type ValidateContext, type ValidateError, type ValidateResult, parseRenameSpec };
598
+ export { type Accepted, type DatabaseDevState, type DatabaseDiff, type DatabaseSource, type DatabaseStatus, type DbCommandDefaults, type DevPaths, type DevServerLock, type DevState, type DiffResult, type DiscoverOptions, type GenerateContext, type GenerateOptions, type GenerateResult, type MigrationRisk, type PushContext, type PushResult, type RenameAnswer, type RenameResolutionOptions, type ResetContext, type ResetOptions, type ResetResult, type RowsFinding, type RowsFindingKind, type RowsReplay, type SchemaAmbiguity, SchemaRenameRequiredError, type StatusContext, type StatusResult, type ValidateContext, type ValidateError, type ValidateResult, parseRenameSpec };
package/dist/cli/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { c as getDatabaseEpochs, d as getInstanceKey, f as init_state, g as runningDevServer, l as getDevEpoch, m as loadDevState, o as generateEpoch, p as loadDevMigrations, s as getDatabaseEpoch, u as getDevPaths, v as saveDevState } from "../state-UT6GH0JD.js";
2
- import { g as parseRenameSpec, u as SchemaRenameRequiredError } from "../snapshot-CCIE4_Le.js";
2
+ import { _ as parseRenameSpec, u as SchemaRenameRequiredError } from "../snapshot-CY4FLqAo.js";
3
3
  import { n as declaresSchema } from "../parser-mUnAtllk.js";
4
- import { _ as discoverDatabases, a as reset, b as reportCliError, c as status, d as generateOne, f as push, g as diffSchema, h as diffDatabases, i as DevServerRunningError, l as UnsafeMigrationError, m as UnknownDatabaseError, n as registerDbCommands, o as resetAndPush, p as pushOne, r as validate, s as formatStatus, t as createDbCommand, u as generate, v as loadSchema, x as selectDatabases, y as loadSchemaTables } from "../cli-CRZWralu.js";
4
+ import { C as diffSchema, D as reportCliError, E as loadSchemaTables, O as selectDatabases, S as diffDatabases, T as loadSchema, _ as sift, a as reset, b as pushOne, c as status, d as generate, f as generateOne, g as replayWithRows, h as readAccepted, i as DevServerRunningError, l as MigrationFailsOnRowsError, m as accept, n as registerDbCommands, o as resetAndPush, p as ACCEPTED_FILE, r as validate, s as formatStatus, t as createDbCommand, u as UnsafeMigrationError, v as writeAccepted, w as discoverDatabases, x as UnknownDatabaseError, y as push } from "../cli--9cKeEka.js";
5
5
  init_state();
6
- export { DevServerRunningError, SchemaRenameRequiredError, UnknownDatabaseError, UnsafeMigrationError, createDbCommand, declaresSchema, diffDatabases, diffSchema, discoverDatabases, formatStatus, generate, generateEpoch, generateOne, getDatabaseEpoch, getDatabaseEpochs, getDevEpoch, getDevPaths, getInstanceKey, loadDevMigrations, loadDevState, loadSchema, loadSchemaTables, parseRenameSpec, push, pushOne, registerDbCommands, reportCliError, reset, resetAndPush, runningDevServer, saveDevState, selectDatabases, status, validate };
6
+ export { ACCEPTED_FILE, DevServerRunningError, MigrationFailsOnRowsError, SchemaRenameRequiredError, UnknownDatabaseError, UnsafeMigrationError, accept, createDbCommand, declaresSchema, diffDatabases, diffSchema, discoverDatabases, formatStatus, generate, generateEpoch, generateOne, getDatabaseEpoch, getDatabaseEpochs, getDevEpoch, getDevPaths, getInstanceKey, loadDevMigrations, loadDevState, loadSchema, loadSchemaTables, parseRenameSpec, push, pushOne, readAccepted, registerDbCommands, replayWithRows, reportCliError, reset, resetAndPush, runningDevServer, saveDevState, selectDatabases, sift, status, validate, writeAccepted };