@vibeorm/migrate 1.3.1 → 2.0.0-alpha.2

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 (61) hide show
  1. package/README.md +33 -66
  2. package/dist/ddl/drop-order.d.ts +25 -0
  3. package/dist/ddl/drop-order.d.ts.map +1 -0
  4. package/dist/ddl/mysql.d.ts +46 -0
  5. package/dist/ddl/mysql.d.ts.map +1 -0
  6. package/dist/ddl/postgres.d.ts +24 -0
  7. package/dist/ddl/postgres.d.ts.map +1 -0
  8. package/dist/ddl/render.d.ts +25 -0
  9. package/dist/ddl/render.d.ts.map +1 -0
  10. package/dist/ddl/sqlite.d.ts +62 -0
  11. package/dist/ddl/sqlite.d.ts.map +1 -0
  12. package/dist/differ.d.ts +33 -0
  13. package/dist/differ.d.ts.map +1 -0
  14. package/dist/down.d.ts +55 -0
  15. package/dist/down.d.ts.map +1 -0
  16. package/dist/enum-values.d.ts +19 -0
  17. package/dist/enum-values.d.ts.map +1 -0
  18. package/dist/execute.d.ts +41 -0
  19. package/dist/execute.d.ts.map +1 -0
  20. package/dist/extensions.d.ts +74 -0
  21. package/dist/extensions.d.ts.map +1 -0
  22. package/dist/index.d.ts +26 -0
  23. package/dist/index.d.ts.map +1 -0
  24. package/dist/index.js +3858 -0
  25. package/dist/index.js.map +31 -0
  26. package/dist/introspect/mysql.d.ts +31 -0
  27. package/dist/introspect/mysql.d.ts.map +1 -0
  28. package/dist/introspect/postgres.d.ts +25 -0
  29. package/dist/introspect/postgres.d.ts.map +1 -0
  30. package/dist/introspect/shared.d.ts +76 -0
  31. package/dist/introspect/shared.d.ts.map +1 -0
  32. package/dist/introspect/sqlite.d.ts +53 -0
  33. package/dist/introspect/sqlite.d.ts.map +1 -0
  34. package/dist/mysql-types.d.ts +66 -0
  35. package/dist/mysql-types.d.ts.map +1 -0
  36. package/dist/normalize.d.ts +115 -0
  37. package/dist/normalize.d.ts.map +1 -0
  38. package/dist/postgres-types.d.ts +95 -0
  39. package/dist/postgres-types.d.ts.map +1 -0
  40. package/dist/push.d.ts +45 -0
  41. package/dist/push.d.ts.map +1 -0
  42. package/dist/relations.d.ts +40 -0
  43. package/dist/relations.d.ts.map +1 -0
  44. package/dist/runner.d.ts +120 -0
  45. package/dist/runner.d.ts.map +1 -0
  46. package/dist/sqlite-types.d.ts +87 -0
  47. package/dist/sqlite-types.d.ts.map +1 -0
  48. package/dist/types.d.ts +217 -0
  49. package/dist/types.d.ts.map +1 -0
  50. package/package.json +33 -23
  51. package/src/cascade-actions.ts +0 -88
  52. package/src/ddl-builder.ts +0 -415
  53. package/src/index.ts +0 -41
  54. package/src/introspector.ts +0 -684
  55. package/src/migration-runner.ts +0 -127
  56. package/src/relation-utils.ts +0 -79
  57. package/src/schema-differ.ts +0 -865
  58. package/src/schema-printer.ts +0 -259
  59. package/src/snapshot.ts +0 -141
  60. package/src/sql-utils.ts +0 -45
  61. package/src/types.ts +0 -13
package/README.md CHANGED
@@ -1,95 +1,62 @@
1
1
  # @vibeorm/migrate
2
2
 
3
- Migration, introspection, and schema diff toolkit for VibeORM. Handles DDL generation, database introspection, schema comparison, migration tracking, and `.prisma` schema printing.
3
+ > Part of **[VibeORM](https://github.com/vibeorm/vibeorm)** — a type-safe TypeScript ORM for Bun and Node. Prisma-schema or TypeScript-DSL input, a canonical schema IR, a generated client, and a dialect-aware SQL layer over PostgreSQL, PGlite, SQLite and MySQL.
4
4
 
5
- ## Installation
5
+ The migration engine: it diffs two schema IRs into dialect-neutral steps, renders those steps as per-dialect DDL, applies them with bookkeeping, and introspects a live database back into IR. It is its own package so that the CLI and tests can run schema changes without pulling in the query runtime, and so every SQL-text decision stays in one reviewable place.
6
6
 
7
7
  ```bash
8
- bun add @vibeorm/migrate
8
+ bun add @vibeorm/migrate@alpha
9
9
  ```
10
10
 
11
- ## Features
11
+ > **Pre-release.** `2.0.0-alpha.x`, published under the `alpha` dist-tag. `npm i vibeorm` still resolves to the stable v1 line.
12
12
 
13
- - **DDL generation** — schema IR to PostgreSQL DDL (enums, tables, constraints, indexes, foreign keys, M:N join tables)
14
- - **Introspection** — reverse-engineer a live PostgreSQL database into schema IR
15
- - **Schema diffing** — compute migration operations between two schema versions
16
- - **Migration runner** — track and apply migrations via a `_vibeorm_migrations` table
17
- - **Snapshot management** — serialize/deserialize schema IR as JSON for diffing
18
- - **Schema printing** — convert schema IR back to `.prisma` format
13
+ Most users never install this directly — it ships as a dependency of [`vibeorm`](https://www.npmjs.com/package/vibeorm) and of the generated client. Reach for it when you are writing an adapter or tooling against the runtime.
19
14
 
20
- ## API
15
+ ## What it does
21
16
 
22
- ### DDL
17
+ Three stages, each usable on its own.
23
18
 
24
- ```ts
25
- import { buildDDL } from "@vibeorm/migrate";
19
+ **Diff.** `diffSchemas({ from, to, dialect })` returns ordered `MigrationStep` values — `createTable`, `addColumn`, `alterColumn`, `createIndex`, `addForeignKey`, `createJoinTable`, `dropView` and the rest. Steps carry IR fragments, never SQL text, and are emitted in dependency-safe order. Both sides normalize before comparison, so `diffSchemas({ from: introspect(push(X)), to: X })` is empty: pushing twice is a no-op. There is no rename detection — a renamed table diffs as drop plus create.
26
20
 
27
- const { sql, statements } = buildDDL({ schema });
28
- // sql: full DDL wrapped in BEGIN/COMMIT
29
- // statements: individual DDL statements
30
- ```
21
+ **Render.** `renderSteps({ steps, dialect, from, to })` produces the SQL strings for postgres, sqlite (including the table-rebuild recipe for ALTERs sqlite cannot express) or mysql. `describeStep({ step })` gives the one-line human description used in CLI output and refusal messages.
31
22
 
32
- ### Introspection
23
+ **Run.** `applyMigrations` executes `MigrationFile`s in order under an advisory lock, recording each in the `_vibe_migrations` bookkeeping table with a sha256 checksum over its statements. Re-applying a migration whose SQL changed is a `VIBE_MIGRATION` error, not a silent divergence. On postgres and sqlite each migration runs inside one transaction with its bookkeeping row; on mysql, where DDL auto-commits, progress is recorded per statement and a re-run resumes from where it stopped. `migrationStatus` reports applied, pending, mismatched and mid-rollback migrations, `rollbackMigration` runs a migration's `downSql`, and `resolveMigration` repairs the bookkeeping table without running SQL.
33
24
 
34
- ```ts
35
- import { introspect } from "@vibeorm/migrate";
25
+ **Introspect.** `introspectPostgres`, `introspectSqlite` and `introspectMysql` read a live database back into `SchemaIR`; `pull` picks the right one for a dialect.
36
26
 
37
- const schema = await introspect({ executor });
38
- // Returns a Schema IR from a live database
39
- ```
27
+ ## push vs migrate
40
28
 
41
- ### Schema Diffing
29
+ `push` goes straight from the live database to your schema — introspect, diff, render, apply — with no files kept. It suits prototyping and disposable databases. `generateMigration` plus `applyMigrations` keeps named, checksummed SQL files you can review and replay, which is what shared and production databases need. Details in [docs/migrations.md](https://github.com/vibeorm/vibeorm/blob/master/docs/migrations.md).
42
30
 
43
- ```ts
44
- import { diffSchemas } from "@vibeorm/migrate";
31
+ ## Destructive steps
45
32
 
46
- const operations = diffSchemas({ previous: oldSchema, current: newSchema });
47
- // Returns DiffOperation[] with isDestructive flags
48
- ```
33
+ Every step carries a `destructive` flag: drops of tables, columns, enums and join tables, plus narrowing type changes. `push` refuses to run when any step is destructive unless you pass `acceptDataLoss: true`, and the thrown `VibeError` (`VIBE_MIGRATION`) lists each offending step by description. `generateMigration` surfaces the same information as `MigrationFile.destructive` so callers can require confirmation before applying. Constructs a dialect cannot express — scalar lists on sqlite and mysql, partial indexes on mysql, removing a value from a surviving enum — throw `VIBE_UNSUPPORTED_CAPABILITY` instead of degrading.
49
34
 
50
- ### Migration Runner
35
+ ## Usage
51
36
 
52
37
  ```ts
53
- import {
54
- ensureMigrationTable,
55
- getAppliedMigrations,
56
- applyMigration,
57
- removeMigrationRecord,
58
- markMigrationApplied,
59
- } from "@vibeorm/migrate";
60
-
61
- await ensureMigrationTable({ executor });
62
- const applied = await getAppliedMigrations({ executor });
63
- await applyMigration({ executor, migrationName: "20260101_init", sql, checksum });
64
- ```
65
-
66
- ### Snapshots
38
+ import { applyMigrations, generateMigration, push, pull } from "@vibeorm/migrate";
39
+ import { toSqlExecutor } from "@vibeorm/runtime";
67
40
 
68
- ```ts
69
- import {
70
- saveSnapshot,
71
- loadLatestSnapshot,
72
- loadSnapshot,
73
- saveJournal,
74
- loadJournal,
75
- generateTimestamp,
76
- computeChecksum,
77
- } from "@vibeorm/migrate";
78
- ```
41
+ const executor = toSqlExecutor({ adapter });
79
42
 
80
- ### Schema Printing
43
+ // Prototyping: make the database match the schema.
44
+ const result = await push({ executor, schema, acceptDataLoss: false });
45
+ console.log(result.steps, result.applied);
81
46
 
82
- ```ts
83
- import { printSchema } from "@vibeorm/migrate";
47
+ // Versioned: render a named migration from a diff, then apply it.
48
+ const migration = generateMigration({ from: previous, to: schema, name: "add_posts", dialect: "postgres" });
49
+ await applyMigrations({ executor, migrations: [migration], dialect: "postgres" });
84
50
 
85
- const prismaText = printSchema({ schema });
86
- // Returns .prisma formatted schema text
51
+ // Introspect the live database back into IR.
52
+ const live = await pull({ executor, dialect: "postgres" });
87
53
  ```
88
54
 
89
- ### Diff Operation Types
90
-
91
- 18 operation types: `createEnum`, `addEnumValue`, `removeEnumValue`, `dropEnum`, `createTable`, `dropTable`, `addColumn`, `dropColumn`, `alterColumnType`, `alterColumnNullability`, `alterColumnDefault`, `addUnique`, `dropUnique`, `addIndex`, `dropIndex`, `addForeignKey`, `dropForeignKey`, `createJoinTable`, `dropJoinTable`.
55
+ `SqlExecutor` calls must all reach the same database session — the engine issues `BEGIN`/`COMMIT`, `PRAGMA` and advisory-lock statements through it. Pool-backed executors must pin one connection for the whole operation.
92
56
 
93
- ## License
57
+ ## Links
94
58
 
95
- [MIT](../../LICENSE)
59
+ - [Documentation](https://github.com/vibeorm/vibeorm/tree/master/docs)
60
+ - [Query API](https://github.com/vibeorm/vibeorm/blob/master/docs/queries.md)
61
+ - [Repository and issues](https://github.com/vibeorm/vibeorm)
62
+ - MIT licensed
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Topological ordering for DROP TABLE statements — children (referencing
3
+ * tables) first.
4
+ *
5
+ * postgres never needs this: `DROP TABLE … CASCADE` takes inbound FK
6
+ * constraints with it. sqlite and mysql have no working cascade for inbound
7
+ * foreign keys — mysql refuses outright (errno 3730
8
+ * `ER_FK_CANNOT_DROP_PARENT`, observed live on 8.4 when a fixture switch
9
+ * dropped `Project` while the also-being-dropped `ProjectMember` still
10
+ * referenced it). ONE shared implementation, consumed by both renderers —
11
+ * the LEARNINGS rule: a structural rule is never re-implemented per consumer.
12
+ */
13
+ import type { NormalizedSchema } from "../normalize.ts";
14
+ /**
15
+ * Order the tables in `names` so that no table is dropped while another
16
+ * to-be-dropped table still references it. Tables unknown to `fromNorm` (or a
17
+ * missing `fromNorm`, or a reference cycle) fall back to the given order —
18
+ * rendering proceeds and the server reports what it cannot do (dialect
19
+ * honesty beats silently dropping statements).
20
+ */
21
+ export declare function orderDropsChildrenFirst(params: {
22
+ names: readonly string[];
23
+ fromNorm: NormalizedSchema | undefined;
24
+ }): string[];
25
+ //# sourceMappingURL=drop-order.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drop-order.d.ts","sourceRoot":"","sources":["../../src/ddl/drop-order.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExD;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE;IAC9C,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,QAAQ,EAAE,gBAAgB,GAAG,SAAS,CAAC;CACxC,GAAG,MAAM,EAAE,CAwCX"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * MySQL DDL renderer: migration steps → SQL statements.
3
+ *
4
+ * Every identifier is backtick-quoted through `mysqlDialect.quoteIdent` — the
5
+ * ONE quoting decision point. Pinned choices:
6
+ *
7
+ * - String → varchar(191): utf8mb4 × 4 bytes keeps indexed String columns
8
+ * inside the 767-byte legacy InnoDB index-key limit (`@db.Text` opts out —
9
+ * TEXT columns are never indexed by us; indexing one would need a prefix
10
+ * length we do not emit).
11
+ * - autoincrement renders `AUTO_INCREMENT` (the column must be a key — the
12
+ * PRIMARY KEY clause in the same CREATE TABLE satisfies that; ALTERing one
13
+ * onto an existing column is refused, pg parity).
14
+ * - Enums are inline `ENUM('A', 'B')` column types; the standalone enum steps
15
+ * (createEnum/dropEnum/addEnumValue) render NOTHING — value changes arrive
16
+ * as alterColumn steps (value-based type keys) and render as MODIFY COLUMN
17
+ * with the widened list.
18
+ * - alterColumn type/nullability → one `MODIFY COLUMN` with the full target
19
+ * definition (mysql redefines the column wholesale); default-only changes
20
+ * use `ALTER COLUMN … SET/DROP DEFAULT`.
21
+ * - No partial indexes on mysql → VIBE_UNSUPPORTED_CAPABILITY naming the
22
+ * index. Index kinds other than btree are refused the same way.
23
+ * - `DROP INDEX … ON table` needs the table — the differ's dropIndex steps
24
+ * carry it; a step without one is a VIBE_MIGRATION error.
25
+ * - `DROP TABLE` has no cascade (mysql parses `CASCADE` and ignores it), and
26
+ * dropping a parent still referenced by another to-be-dropped table fails
27
+ * with errno 3730 `ER_FK_CANNOT_DROP_PARENT` (observed live on 8.4). FK
28
+ * drops on SURVIVING tables come from the differ's bucket order; drops of
29
+ * whole dependent groups are topologically reordered children-first here
30
+ * (the shared `orderDropsChildrenFirst`, same rule as sqlite).
31
+ */
32
+ import type { SchemaIR } from "@vibeorm/schema";
33
+ import type { MigrationStep } from "../types.ts";
34
+ /**
35
+ * Render migration steps to mysql SQL. `to` (the target schema) is required
36
+ * whenever an enum column is rendered — the inline `ENUM(…)` type needs the
37
+ * enum's values, which live on the schema, not the step. `from` enables the
38
+ * topological drop order (children before referenced parents); without it,
39
+ * drops render in step order.
40
+ */
41
+ export declare function renderMysqlSteps(params: {
42
+ steps: readonly MigrationStep[];
43
+ from?: SchemaIR;
44
+ to?: SchemaIR;
45
+ }): string[];
46
+ //# sourceMappingURL=mysql.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mysql.d.ts","sourceRoot":"","sources":["../../src/ddl/mysql.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAGH,OAAO,KAAK,EAAmB,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAMjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE;IACvC,KAAK,EAAE,SAAS,aAAa,EAAE,CAAC;IAChC,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,EAAE,CAAC,EAAE,QAAQ,CAAC;CACf,GAAG,MAAM,EAAE,CAwBX"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Postgres DDL renderer: migration steps → SQL statements.
3
+ *
4
+ * Every identifier is quoted through `postgresDialect.quoteIdent` — the ONE
5
+ * quoting decision point (@vibeorm/sql). Choices, each pinned by a renderer
6
+ * test:
7
+ *
8
+ * - autoincrement renders as `GENERATED BY DEFAULT AS IDENTITY` (SQL-standard,
9
+ * no sequence-name coupling; postgres ≥10 and pglite both support it) — not
10
+ * SERIAL. The introspector maps identity columns back to autoincrement.
11
+ * - `DROP TABLE ... CASCADE`: inbound FK constraints drop with the table.
12
+ * - scalar→array type changes carry the LEARNINGS `USING CASE WHEN col IS NULL
13
+ * THEN NULL ELSE ARRAY[col] END` repair clause (postgres cannot implicit-cast).
14
+ * - `ALTER TYPE ... ADD VALUE IF NOT EXISTS` appends at the end of the enum
15
+ * (no BEFORE/AFTER positioning); fine inside a transaction on postgres ≥12.
16
+ * - Unsupported columns render their `nativeType` verbatim and migrate like
17
+ * any other column.
18
+ */
19
+ import type { MigrationStep } from "../types.ts";
20
+ /** Render migration steps to postgres SQL (one string per statement, in order). */
21
+ export declare function renderPostgresSteps(params: {
22
+ steps: readonly MigrationStep[];
23
+ }): string[];
24
+ //# sourceMappingURL=postgres.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"postgres.d.ts","sourceRoot":"","sources":["../../src/ddl/postgres.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAYH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,mFAAmF;AACnF,wBAAgB,mBAAmB,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,SAAS,aAAa,EAAE,CAAA;CAAE,GAAG,MAAM,EAAE,CAEzF"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Dialect dispatcher for DDL rendering — the ONE public entry point. Routes to
3
+ * the per-dialect renderers (ddl/postgres.ts, ddl/sqlite.ts, ddl/mysql.ts) so
4
+ * every SQL-text decision stays in exactly one dialect module.
5
+ */
6
+ import type { Dialect, SchemaIR } from "@vibeorm/schema";
7
+ import type { MigrationStep } from "../types.ts";
8
+ /**
9
+ * Render migration steps to SQL statements (one string per statement, in
10
+ * order) for a dialect.
11
+ *
12
+ * `from`/`to` — the schemas the steps were diffed from — are OPTIONAL for
13
+ * postgres (ignored) but needed by sqlite whenever a step compiles to the
14
+ * table-rebuild recipe (the target table shape lives on the schema, not the
15
+ * step) and by sqlite/mysql for enum columns (CHECK / inline ENUM values).
16
+ * `generateMigration` and `push` always pass them; direct callers rendering
17
+ * rebuild-free, enum-free steps may omit them.
18
+ */
19
+ export declare function renderSteps(params: {
20
+ steps: readonly MigrationStep[];
21
+ dialect: Dialect;
22
+ from?: SchemaIR;
23
+ to?: SchemaIR;
24
+ }): string[];
25
+ //# sourceMappingURL=render.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/ddl/render.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAIzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE;IAClC,KAAK,EAAE,SAAS,aAAa,EAAE,CAAC;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,EAAE,CAAC,EAAE,QAAQ,CAAC;CACf,GAAG,MAAM,EAAE,CAkBX"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * SQLite DDL renderer: migration steps → SQL statements, including THE TABLE
3
+ * REBUILD — sqlite has no ALTER COLUMN, cannot add/drop constraints, and its
4
+ * DROP COLUMN is heavily restricted, so any such step compiles to the
5
+ * documented 12-step recipe (https://sqlite.org/lang_altertable.html §7),
6
+ * emitted as an ordered, self-contained statement block:
7
+ *
8
+ * PRAGMA foreign_keys=OFF;
9
+ * BEGIN;
10
+ * CREATE TABLE "T_new" (…target shape: columns, PK, FKs, enum CHECKs…);
11
+ * INSERT INTO "T_new" (common cols) SELECT common cols FROM "T";
12
+ * DROP TABLE "T";
13
+ * ALTER TABLE "T_new" RENAME TO "T";
14
+ * CREATE …INDEX… (every index of the target table);
15
+ * PRAGMA foreign_key_check;
16
+ * COMMIT;
17
+ * PRAGMA foreign_keys=ON;
18
+ *
19
+ * Because the block manages its own transaction (PRAGMA foreign_keys is a
20
+ * no-op inside one), callers must NOT wrap scripts containing it — push and
21
+ * the runner detect this via `usesSelfManagedTransactions` (execute.ts).
22
+ * Rebuild blocks are emitted AFTER all other statements so a rebuilt table's
23
+ * new FKs can reference tables created earlier in the same script.
24
+ *
25
+ * Cheap paths are preferred wherever sqlite's plain ALTER suffices:
26
+ * `ADD COLUMN` (unless the column is required without a literal default, or
27
+ * defaults to CURRENT_TIMESTAMP / an expression — both forbidden in ADD
28
+ * COLUMN) and `DROP COLUMN` (unless the column is in the PK, any index or
29
+ * partial-index predicate, an FK on either side, or carries an enum CHECK).
30
+ *
31
+ * Column-value transfer on rebuild: dropped columns are omitted, added
32
+ * columns take their default (or NULL), type-changed columns are a PLAIN COPY
33
+ * — sqlite's flexible typing keeps the stored values as-is, so e.g. non-numeric
34
+ * TEXT survives verbatim inside an INTEGER column (documented lossy-ness:
35
+ * nothing is coerced, nothing is validated beyond the new CHECK constraints).
36
+ *
37
+ * Other pinned choices:
38
+ * - autoincrement renders `INTEGER PRIMARY KEY AUTOINCREMENT` (monotonic ids,
39
+ * Prisma parity) — plain `INTEGER PRIMARY KEY` would reuse rowids after
40
+ * deletes. The `PRIMARY KEY AUTOINCREMENT` text is also the introspection
41
+ * marker. Costs the `sqlite_sequence` bookkeeping table (skipped on pull).
42
+ * - Composite / non-autoincrement PKs render as an unnamed table-level
43
+ * `PRIMARY KEY (…)` (sqlite keeps constraint names only as noise).
44
+ * - Enums render TEXT + a NAMED column-level CHECK (see sqlite-types.ts) —
45
+ * the name (`<table>_<column>_enum_<Enum>`) is how pull recovers the enum.
46
+ * - `DROP TABLE` has no CASCADE on sqlite; table drops are topologically
47
+ * ordered (referencing tables first) using the `from` schema.
48
+ * - Index kinds other than btree/unique throw VIBE_UNSUPPORTED_CAPABILITY.
49
+ */
50
+ import type { SchemaIR } from "@vibeorm/schema";
51
+ import type { MigrationStep } from "../types.ts";
52
+ /**
53
+ * Render migration steps to sqlite SQL. `from`/`to` (the schemas that produced
54
+ * the steps) are required whenever a step triggers a table rebuild or renders
55
+ * an enum column — `generateMigration` and `push` always pass them.
56
+ */
57
+ export declare function renderSqliteSteps(params: {
58
+ steps: readonly MigrationStep[];
59
+ from?: SchemaIR;
60
+ to?: SchemaIR;
61
+ }): string[];
62
+ //# sourceMappingURL=sqlite.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sqlite.d.ts","sourceRoot":"","sources":["../../src/ddl/sqlite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAGH,OAAO,KAAK,EAAmB,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAajE,OAAO,KAAK,EAAe,aAAa,EAAE,MAAM,aAAa,CAAC;AAI9D;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE;IACxC,KAAK,EAAE,SAAS,aAAa,EAAE,CAAC;IAChC,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,EAAE,CAAC,EAAE,QAAQ,CAAC;CACf,GAAG,MAAM,EAAE,CAkLX"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * IR-vs-IR schema differ → dialect-neutral migration steps.
3
+ *
4
+ * The contract that matters most: `diffSchemas({ from: introspect(push(X)),
5
+ * to: X })` is EMPTY — both sides normalize through normalize.ts before
6
+ * comparison, so representation differences (implicit list sides vs explicit
7
+ * M2M fields, `@unique` vs `@@unique`, app-level defaults, cascade-action
8
+ * defaults) never produce phantom steps and `db push` twice is a no-op.
9
+ *
10
+ * No rename detection (v1 parity): a renamed table/column diffs as drop +
11
+ * create. Removing a value from a surviving enum throws
12
+ * VIBE_UNSUPPORTED_CAPABILITY — postgres cannot drop enum values without a
13
+ * manual type rebuild, and silence would be dialect dishonesty.
14
+ */
15
+ import type { Dialect, SchemaIR } from "@vibeorm/schema";
16
+ import type { MigrationStep } from "./types.ts";
17
+ /**
18
+ * Diff two Schema IRs into an ordered list of dialect-neutral migration steps
19
+ * that transform the `from` database shape into the `to` shape.
20
+ *
21
+ * `dialect` (default postgres) selects the comparison rules: sqlite/mysql
22
+ * compare columns by physical type (see normalize.ts), refuse scalar-list
23
+ * columns up front (no array types — VIBE_UNSUPPORTED_CAPABILITY naming the
24
+ * model.field), skip standalone enum steps (their enums are inline: TEXT +
25
+ * CHECK on sqlite, `ENUM(…)` on mysql — value changes flow through
26
+ * `alterColumn`), and refuse enum-value REMOVAL at the column level.
27
+ */
28
+ export declare function diffSchemas(params: {
29
+ from: SchemaIR;
30
+ to: SchemaIR;
31
+ dialect?: Dialect;
32
+ }): MigrationStep[];
33
+ //# sourceMappingURL=differ.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"differ.d.ts","sourceRoot":"","sources":["../src/differ.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAU,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAKjE,OAAO,KAAK,EAAqB,aAAa,EAAE,MAAM,YAAY,CAAC;AAkCnE;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE;IAClC,IAAI,EAAE,QAAQ,CAAC;IACf,EAAE,EAAE,QAAQ,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,aAAa,EAAE,CAsDlB"}
package/dist/down.d.ts ADDED
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Down-migration generation: the REVERSE diff of an up migration, with v1's
3
+ * two rollback rules baked in (LEARNINGS / issue #15):
4
+ *
5
+ * 1. RE-ADDED COLUMNS COME BACK NULLABLE. The reverse of `dropColumn` is
6
+ * `addColumn`, but the dropped column's data is gone — re-adding it
7
+ * NOT NULL would fail on any populated table. Every `addColumn` step in a
8
+ * down migration is therefore forced optional (its default, when present,
9
+ * is kept). Whole-table re-creates (`createTable`) keep their NOT NULLs:
10
+ * the re-created table is empty.
11
+ * 2. IRREVERSIBLE UP-STEPS ARE SKIPPED, NOT THROWN. An up migration that
12
+ * added an enum value has no reverse — postgres cannot drop enum values,
13
+ * and sqlite/mysql refuse narrowing an inline enum whose rows may hold the
14
+ * value. The rollback target keeps those values and the skip is reported
15
+ * in `skipped`, so "undo the last migration" still works (v1's
16
+ * `isReversible: false` behavior).
17
+ *
18
+ * Extension artifacts: object artifacts the up migration created (columns,
19
+ * indexes, shadow tables, triggers) are dropped by the down migration via
20
+ * their own `drop` SQL. `CREATE EXTENSION`-class artifacts are never dropped
21
+ * — other database objects may depend on the extension — and are reported in
22
+ * `skipped` instead.
23
+ */
24
+ import type { Dialect, SchemaIR, VibeExtension } from "@vibeorm/schema";
25
+ /** A generated down migration: reverse SQL plus what could NOT be reversed. */
26
+ export type DownMigrationFile = {
27
+ readonly name: string;
28
+ /** One SQL string per statement, in execution order. */
29
+ readonly sql: readonly string[];
30
+ /** True when any reverse step can lose data (e.g. dropping an up-added column). */
31
+ readonly destructive: boolean;
32
+ /**
33
+ * Human descriptions of up-changes this down migration cannot reverse
34
+ * (added enum values, installed postgres extensions). Empty = full reverse.
35
+ */
36
+ readonly skipped: readonly string[];
37
+ };
38
+ /**
39
+ * Generate the DOWN migration for an up migration described by the same
40
+ * `from`/`to` pair handed to `generateMigration`: `from` is the current
41
+ * database shape, `to` the schema the up migration moves to. The down
42
+ * migration transforms `to` back into `from` (modulo the skipped
43
+ * irreversibles), so callers write it alongside the up file and apply it
44
+ * newest-first to roll back.
45
+ */
46
+ export declare function generateDownMigration(params: {
47
+ from: SchemaIR;
48
+ to: SchemaIR;
49
+ name: string;
50
+ /** Rendering dialect; postgres if omitted. */
51
+ dialect?: Dialect;
52
+ /** Configured extension instances — their up-created artifacts are dropped. */
53
+ extensions?: readonly VibeExtension[];
54
+ }): DownMigrationFile;
55
+ //# sourceMappingURL=down.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"down.d.ts","sourceRoot":"","sources":["../src/down.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAU,QAAQ,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAYhF,+EAA+E;AAC/E,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,wDAAwD;IACxD,QAAQ,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,mFAAmF;IACnF,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC,CAAC;AAyDF;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE;IAC5C,IAAI,EAAE,QAAQ,CAAC;IACf,EAAE,EAAE,QAAQ,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,+EAA+E;IAC/E,UAAU,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;CACvC,GAAG,iBAAiB,CAuDpB"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Enum-value resolution shared by the sqlite/mysql type mappers.
3
+ *
4
+ * On dialects without named enum types (sqlite: TEXT + CHECK, mysql: inline
5
+ * `ENUM(...)`) the enum's NAME does not survive in the database — only its
6
+ * VALUES do. Column comparison keys and DDL rendering therefore resolve a
7
+ * field's enum reference to its value list; the name is presentation only.
8
+ */
9
+ import type { EnumIR } from "@vibeorm/schema";
10
+ /**
11
+ * Resolve an enum name to its values. The map is keyed by db name
12
+ * (`dbName ?? name`, the normalize.ts convention); a schema-side reference by
13
+ * IR name falls back to a scan so both key styles resolve.
14
+ */
15
+ export declare function resolveEnumValues(params: {
16
+ name: string;
17
+ enums: ReadonlyMap<string, EnumIR>;
18
+ }): readonly string[] | undefined;
19
+ //# sourceMappingURL=enum-values.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enum-values.d.ts","sourceRoot":"","sources":["../src/enum-values.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE9C;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACpC,GAAG,SAAS,MAAM,EAAE,GAAG,SAAS,CAQhC"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Statement-execution helpers shared by push and the migration runner.
3
+ *
4
+ * Two sqlite realities live here:
5
+ *
6
+ * - SELF-MANAGED SCRIPTS: the table-rebuild recipe (ddl/sqlite.ts) carries its
7
+ * own `PRAGMA foreign_keys=OFF; BEGIN; … COMMIT; PRAGMA foreign_keys=ON;`
8
+ * sequence, because `PRAGMA foreign_keys` is a no-op inside a transaction.
9
+ * Callers must NOT wrap such scripts in an outer BEGIN/COMMIT —
10
+ * `usesSelfManagedTransactions` detects them. Plain statements in a
11
+ * self-managed script auto-commit individually (documented sqlite
12
+ * limitation: a mixed script is not atomic as a whole; each rebuild block
13
+ * is).
14
+ * - `PRAGMA foreign_key_check` RETURNS VIOLATION ROWS instead of failing —
15
+ * `executeStatement` runs it row-returning (`values: []`, the adapter-sqlite
16
+ * contract for reads) and throws VIBE_MIGRATION when any come back.
17
+ */
18
+ import type { Dialect } from "@vibeorm/schema";
19
+ import type { SqlExecutor } from "./types.ts";
20
+ /** True when the script manages its own transactions (sqlite rebuilds). */
21
+ export declare function usesSelfManagedTransactions(params: {
22
+ sql: readonly string[];
23
+ }): boolean;
24
+ /**
25
+ * Execute one migration statement. On sqlite, `PRAGMA foreign_key_check` is
26
+ * executed row-returning and its violations become a VIBE_MIGRATION error.
27
+ */
28
+ export declare function executeStatement(params: {
29
+ executor: SqlExecutor;
30
+ statement: string;
31
+ dialect: Dialect;
32
+ }): Promise<void>;
33
+ /**
34
+ * Best-effort cleanup after a failed self-managed sqlite script: roll back a
35
+ * possibly-open rebuild transaction and restore FK enforcement. Never throws
36
+ * — the original failure matters more.
37
+ */
38
+ export declare function cleanupSelfManagedFailure(params: {
39
+ executor: SqlExecutor;
40
+ }): Promise<void>;
41
+ //# sourceMappingURL=execute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../src/execute.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAO9C,2EAA2E;AAC3E,wBAAgB,2BAA2B,CAAC,MAAM,EAAE;IAAE,GAAG,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GAAG,OAAO,CAEvF;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,MAAM,EAAE;IAC7C,QAAQ,EAAE,WAAW,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;CAClB,GAAG,OAAO,CAAC,IAAI,CAAC,CAkBhB;AAED;;;;GAIG;AACH,wBAAsB,yBAAyB,CAAC,MAAM,EAAE;IAAE,QAAQ,EAAE,WAAW,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAWhG"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Extension artifacts in the migrate pipeline (extensions.md §3 migrate plane).
3
+ *
4
+ * Extensions own database objects the core differ does not model: CREATE
5
+ * EXTENSION, generated tsvector columns, FTS5 shadow tables + triggers,
6
+ * specialty indexes (gin_trgm_ops, hnsw, bm25, FULLTEXT). The contract:
7
+ *
8
+ * 1. `collectExtensionArtifacts` asks each configured extension for its
9
+ * artifacts (dialect-correct, idempotent SQL + a structured owner).
10
+ * 2. `stripExtensionArtifacts` removes owned objects from the INTROSPECTED
11
+ * IR before diffing, so the core differ never schedules their drop —
12
+ * the introspector-representation-is-the-contract rule (LEARNINGS).
13
+ * 3. `planMissingArtifacts` decides which artifacts must be created, by
14
+ * checking the introspected IR for their owners (columns, indexes,
15
+ * tables by name); non-introspectable owners (postgres extensions,
16
+ * triggers) rely on their idempotent IF NOT EXISTS forms and always run.
17
+ *
18
+ * Removing a declaration does NOT auto-drop its artifacts (mirrors the v1
19
+ * phantom-join-table precedent) — `drop` SQL is carried for tooling, not
20
+ * scheduled by push.
21
+ */
22
+ import type { Dialect, ExtensionArtifact, SchemaIR, VibeExtension } from "@vibeorm/schema";
23
+ /** Artifacts of every configured extension for this schema, in order. */
24
+ export type CollectedArtifacts = {
25
+ /** CREATE EXTENSION-class artifacts — run BEFORE the core diff SQL. */
26
+ readonly setup: readonly ExtensionArtifact[];
27
+ /** Object artifacts (columns, indexes, shadow tables, triggers) — run AFTER. */
28
+ readonly objects: readonly ExtensionArtifact[];
29
+ };
30
+ export declare function collectExtensionArtifacts(params: {
31
+ schema: SchemaIR;
32
+ dialect: Dialect;
33
+ extensions: readonly VibeExtension[];
34
+ }): CollectedArtifacts;
35
+ /**
36
+ * Remove extension-owned objects from an INTROSPECTED SchemaIR so the core
37
+ * differ never sees them (they are neither dropped nor re-created by it).
38
+ */
39
+ export declare function stripExtensionArtifacts(params: {
40
+ schema: SchemaIR;
41
+ artifacts: readonly ExtensionArtifact[];
42
+ }): SchemaIR;
43
+ /** Owner presence the IR cannot answer, probed live by push (both optional). */
44
+ export type InstalledExtensionState = {
45
+ /** `SELECT extname FROM pg_extension` — postgres only. */
46
+ readonly pgExtensions?: ReadonlySet<string>;
47
+ /** `sqlite_master WHERE type='trigger'` names — sqlite only. */
48
+ readonly triggers?: ReadonlySet<string>;
49
+ };
50
+ /**
51
+ * The artifacts whose owner is missing from the introspected IR (must be
52
+ * created). Owners the IR cannot see — postgres extensions and triggers —
53
+ * consult the live-probed `installed` state when given, else always plan;
54
+ * their `create` SQL is idempotent (IF NOT EXISTS) so replays converge.
55
+ */
56
+ export declare function planMissingArtifacts(params: {
57
+ introspected: SchemaIR;
58
+ artifacts: readonly ExtensionArtifact[];
59
+ installed?: InstalledExtensionState;
60
+ }): ExtensionArtifact[];
61
+ /** Probe live owner state the IR cannot carry (used by push before planning). */
62
+ export declare function probeInstalledExtensionState(params: {
63
+ executor: (execParams: {
64
+ text: string;
65
+ values?: unknown[];
66
+ }) => Promise<Record<string, unknown>[]>;
67
+ dialect: Dialect;
68
+ artifacts: readonly ExtensionArtifact[];
69
+ }): Promise<InstalledExtensionState>;
70
+ /** Flatten artifacts to their create statements, in order. */
71
+ export declare function artifactCreateSql(params: {
72
+ artifacts: readonly ExtensionArtifact[];
73
+ }): string[];
74
+ //# sourceMappingURL=extensions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../src/extensions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,KAAK,EACV,OAAO,EACP,iBAAiB,EAEjB,QAAQ,EACR,aAAa,EACd,MAAM,iBAAiB,CAAC;AAIzB,yEAAyE;AACzE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,uEAAuE;IACvE,QAAQ,CAAC,KAAK,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAC7C,gFAAgF;IAChF,QAAQ,CAAC,OAAO,EAAE,SAAS,iBAAiB,EAAE,CAAC;CAChD,CAAC;AAEF,wBAAgB,yBAAyB,CAAC,MAAM,EAAE;IAChD,MAAM,EAAE,QAAQ,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,SAAS,aAAa,EAAE,CAAC;CACtC,GAAG,kBAAkB,CAwBrB;AAkBD;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE;IAC9C,MAAM,EAAE,QAAQ,CAAC;IACjB,SAAS,EAAE,SAAS,iBAAiB,EAAE,CAAC;CACzC,GAAG,QAAQ,CAyCX;AAID,gFAAgF;AAChF,MAAM,MAAM,uBAAuB,GAAG;IACpC,0DAA0D;IAC1D,QAAQ,CAAC,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC5C,gEAAgE;IAChE,QAAQ,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACzC,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE;IAC3C,YAAY,EAAE,QAAQ,CAAC;IACvB,SAAS,EAAE,SAAS,iBAAiB,EAAE,CAAC;IACxC,SAAS,CAAC,EAAE,uBAAuB,CAAC;CACrC,GAAG,iBAAiB,EAAE,CA8BtB;AAED,iFAAiF;AACjF,wBAAsB,4BAA4B,CAAC,MAAM,EAAE;IACzD,QAAQ,EAAE,CAAC,UAAU,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAA;KAAE,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;IACnG,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,SAAS,iBAAiB,EAAE,CAAC;CACzC,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAiBnC;AAED,8DAA8D;AAC9D,wBAAgB,iBAAiB,CAAC,MAAM,EAAE;IACxC,SAAS,EAAE,SAAS,iBAAiB,EAAE,CAAC;CACzC,GAAG,MAAM,EAAE,CAEX"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @vibeorm/migrate — schema diffing, per-dialect DDL rendering, migration
3
+ * running, push/pull and database introspection for VibeORM v2.
4
+ *
5
+ * All three dialects are live: postgres/pglite, sqlite (table-rebuild recipe
6
+ * for the ALTERs sqlite cannot express) and mysql (non-transactional runner
7
+ * with per-statement resume). `renderSteps` / `push` / `pull` /
8
+ * `generateMigration` / `applyMigrations` route per dialect; the per-dialect
9
+ * modules live under src/ddl/ and src/introspect/.
10
+ */
11
+ export { describeStep } from "./types.ts";
12
+ export type { AlterColumnAspect, AppliedResult, IndexColumn, JoinTableEnd, MigrationFile, MigrationStatus, MigrationStep, PushResult, SqlExecutor, } from "./types.ts";
13
+ export { diffSchemas } from "./differ.ts";
14
+ export { detectImplicitM2MPairs } from "./relations.ts";
15
+ export type { ImplicitM2MPair } from "./relations.ts";
16
+ export { renderSteps } from "./ddl/render.ts";
17
+ export { introspectPostgres } from "./introspect/postgres.ts";
18
+ export { introspectSqlite } from "./introspect/sqlite.ts";
19
+ export { introspectMysql } from "./introspect/mysql.ts";
20
+ export { MIGRATIONS_TABLE_NAME, applyMigrations, ensureMigrationsTable, generateMigration, migrationChecksum, migrationStatus, resolveMigration, rollbackMigration, } from "./runner.ts";
21
+ export { generateDownMigration } from "./down.ts";
22
+ export type { DownMigrationFile } from "./down.ts";
23
+ export { pull, push } from "./push.ts";
24
+ export { artifactCreateSql, collectExtensionArtifacts, planMissingArtifacts, probeInstalledExtensionState, stripExtensionArtifacts, } from "./extensions.ts";
25
+ export type { CollectedArtifacts, InstalledExtensionState } from "./extensions.ts";
26
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,YAAY,EACV,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,YAAY,EACZ,aAAa,EACb,eAAe,EACf,aAAa,EACb,UAAU,EACV,WAAW,GACZ,MAAM,YAAY,CAAC;AAIpB,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAItD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAI9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAIxD,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,aAAa,CAAC;AAIrB,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,YAAY,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAInD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAIvC,OAAO,EACL,iBAAiB,EACjB,yBAAyB,EACzB,oBAAoB,EACpB,4BAA4B,EAC5B,uBAAuB,GACxB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC"}