@danceroutine/tango-migrations 0.1.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +114 -0
  3. package/dist/{CollectingBuilder-C6qnwyrb.js → CollectingBuilder--4fqDQdE.js} +17 -2
  4. package/dist/CollectingBuilder--4fqDQdE.js.map +1 -0
  5. package/dist/{CompilerStrategy-Cv1woBmO.js → CompilerStrategy-yKw-Egxv.js} +19 -8
  6. package/dist/CompilerStrategy-yKw-Egxv.js.map +1 -0
  7. package/dist/InternalColumnType-G9zV9StN.js +16 -0
  8. package/dist/InternalColumnType-G9zV9StN.js.map +1 -0
  9. package/dist/InternalOperationKind-Bt6Weuon.js +19 -0
  10. package/dist/InternalOperationKind-Bt6Weuon.js.map +1 -0
  11. package/dist/{IntrospectorStrategy-BM1Eizfc.js → IntrospectorStrategy-blvwSU3_.js} +13 -4
  12. package/dist/IntrospectorStrategy-blvwSU3_.js.map +1 -0
  13. package/dist/Migration-DYQ0hUG7.js +30 -0
  14. package/dist/Migration-DYQ0hUG7.js.map +1 -0
  15. package/dist/{MigrationGenerator-Z39LTKmC.js → MigrationGenerator-B1p0jHnx.js} +20 -12
  16. package/dist/MigrationGenerator-B1p0jHnx.js.map +1 -0
  17. package/dist/{MigrationRunner-CCFuPUlr.js → MigrationRunner-D1ZfbbS-.js} +52 -9
  18. package/dist/MigrationRunner-D1ZfbbS-.js.map +1 -0
  19. package/dist/MigrationSqlSafetyAdapter-CGRbB2k2.js +62 -0
  20. package/dist/MigrationSqlSafetyAdapter-CGRbB2k2.js.map +1 -0
  21. package/dist/{SqliteCompilerFactory-DwMwO7xY.js → SqliteCompilerFactory-BAodJW9n.js} +73 -51
  22. package/dist/SqliteCompilerFactory-BAodJW9n.js.map +1 -0
  23. package/dist/{SqliteIntrospector-BRdNt6KG.js → SqliteIntrospector-CWwPWhmA.js} +49 -5
  24. package/dist/SqliteIntrospector-CWwPWhmA.js.map +1 -0
  25. package/dist/builder/contracts/ColumnSpec.d.ts +2 -1
  26. package/dist/builder/contracts/UpdateReferentialAction.d.ts +1 -1
  27. package/dist/builder/index.js +4 -4
  28. package/dist/builder/ops/OpBuilder.d.ts +48 -7
  29. package/dist/builder/runtime/CollectingBuilder.d.ts +19 -1
  30. package/dist/{builder-Dtk8oP_Y.js → builder-xJ-Bq2pk.js} +51 -21
  31. package/dist/builder-xJ-Bq2pk.js.map +1 -0
  32. package/dist/cli-DhCn8xiS.js +313 -0
  33. package/dist/cli-DhCn8xiS.js.map +1 -0
  34. package/dist/cli.js +17 -169
  35. package/dist/cli.js.map +1 -1
  36. package/dist/commands/cli.d.ts +5 -0
  37. package/dist/commands/index.d.ts +4 -0
  38. package/dist/commands/index.js +17 -0
  39. package/dist/commands-DIJepqNg.js +10 -0
  40. package/dist/commands-DIJepqNg.js.map +1 -0
  41. package/dist/compilers/contracts/CompilerFactory.d.ts +4 -0
  42. package/dist/compilers/contracts/SQLCompiler.d.ts +4 -0
  43. package/dist/compilers/dialects/PostgresCompiler.d.ts +10 -1
  44. package/dist/compilers/dialects/SqliteCompiler.d.ts +10 -0
  45. package/dist/compilers/factories/PostgresCompilerFactory.d.ts +9 -0
  46. package/dist/compilers/factories/SqliteCompilerFactory.d.ts +9 -0
  47. package/dist/compilers/index.js +5 -4
  48. package/dist/{compilers-D8DJuTnQ.js → compilers-dRN0Hzev.js} +2 -2
  49. package/dist/{compilers-D8DJuTnQ.js.map → compilers-dRN0Hzev.js.map} +1 -1
  50. package/dist/diff/diffSchema.d.ts +6 -1
  51. package/dist/diff/index.js +6 -6
  52. package/dist/{diff-Cs0TPEGR.js → diff-CZZbXAPN.js} +2 -2
  53. package/dist/{diff-Cs0TPEGR.js.map → diff-CZZbXAPN.js.map} +1 -1
  54. package/dist/{diffSchema-KgGHP-s3.js → diffSchema-D4oemTWS.js} +5 -4
  55. package/dist/diffSchema-D4oemTWS.js.map +1 -0
  56. package/dist/domain/Migration.d.ts +17 -0
  57. package/dist/domain/MigrationOperation.d.ts +14 -13
  58. package/dist/domain/index.js +2 -2
  59. package/dist/domain/internal/InternalColumnType.d.ts +11 -10
  60. package/dist/domain/internal/InternalDialect.d.ts +5 -4
  61. package/dist/domain/internal/InternalMigrationMode.d.ts +5 -4
  62. package/dist/domain/internal/InternalOperationKind.d.ts +14 -13
  63. package/dist/domain/internal/InternalReferentialAction.d.ts +7 -6
  64. package/dist/{domain-BXVlG0C0.js → domain-CwR-kUNS.js} +2 -2
  65. package/dist/{domain-BXVlG0C0.js.map → domain-CwR-kUNS.js.map} +1 -1
  66. package/dist/generator/MigrationGenerator.d.ts +13 -0
  67. package/dist/generator/index.js +3 -3
  68. package/dist/{generator-3yC60b1u.js → generator-DK-_f-PF.js} +2 -2
  69. package/dist/{generator-3yC60b1u.js.map → generator-DK-_f-PF.js.map} +1 -1
  70. package/dist/index.d.ts +4 -0
  71. package/dist/index.js +24 -20
  72. package/dist/internal/MigrationSqlSafetyAdapter.d.ts +24 -0
  73. package/dist/introspect/DatabaseIntrospector.d.ts +8 -0
  74. package/dist/introspect/PostgresIntrospector.d.ts +14 -0
  75. package/dist/introspect/SqliteIntrospector.d.ts +13 -0
  76. package/dist/introspect/index.js +3 -2
  77. package/dist/{introspect-ks-QSodq.js → introspect-TPv_jeD6.js} +2 -2
  78. package/dist/{introspect-ks-QSodq.js.map → introspect-TPv_jeD6.js.map} +1 -1
  79. package/dist/runner/MigrationRunner.d.ts +7 -1
  80. package/dist/runner/index.js +9 -8
  81. package/dist/{runner-BOs-tItW.js → runner-C97xT8_W.js} +2 -2
  82. package/dist/{runner-BOs-tItW.js.map → runner-C97xT8_W.js.map} +1 -1
  83. package/dist/runtime/loadModule.d.ts +15 -0
  84. package/dist/strategies/CompilerStrategy.d.ts +19 -1
  85. package/dist/strategies/IntrospectorStrategy.d.ts +16 -1
  86. package/dist/strategies/index.js +8 -7
  87. package/dist/{strategies-BvHwf4as.js → strategies-D9ymSvbG.js} +3 -3
  88. package/dist/{strategies-BvHwf4as.js.map → strategies-D9ymSvbG.js.map} +1 -1
  89. package/package.json +98 -92
  90. package/dist/CollectingBuilder-C6qnwyrb.js.map +0 -1
  91. package/dist/CompilerStrategy-Cv1woBmO.js.map +0 -1
  92. package/dist/InternalColumnType-_YAz7RqI.js +0 -17
  93. package/dist/InternalColumnType-_YAz7RqI.js.map +0 -1
  94. package/dist/InternalOperationKind-BPVoOQwD.js +0 -20
  95. package/dist/InternalOperationKind-BPVoOQwD.js.map +0 -1
  96. package/dist/IntrospectorStrategy-BM1Eizfc.js.map +0 -1
  97. package/dist/Migration-D9J6ZbLP.js +0 -25
  98. package/dist/Migration-D9J6ZbLP.js.map +0 -1
  99. package/dist/MigrationGenerator-Z39LTKmC.js.map +0 -1
  100. package/dist/MigrationRunner-CCFuPUlr.js.map +0 -1
  101. package/dist/SqliteCompilerFactory-DwMwO7xY.js.map +0 -1
  102. package/dist/SqliteIntrospector-BRdNt6KG.js.map +0 -1
  103. package/dist/builder/ops/OpBuilder.js +0 -173
  104. package/dist/builder-Dtk8oP_Y.js.map +0 -1
  105. package/dist/diffSchema-KgGHP-s3.js.map +0 -1
  106. package/dist/domain/MigrationOperation.js +0 -1
@@ -1,4 +1,8 @@
1
1
  import type { SQLCompiler } from './SQLCompiler';
2
+ /**
3
+ * Factory contract for SQL compiler instances.
4
+ */
2
5
  export interface CompilerFactory {
6
+ /** Create a compiler instance. */
3
7
  create(): SQLCompiler;
4
8
  }
@@ -1,5 +1,9 @@
1
1
  import type { MigrationOperation } from '../../domain/MigrationOperation';
2
2
  import type { SQL } from './SQL';
3
+ /**
4
+ * Contract for dialect-specific migration SQL compilers.
5
+ */
3
6
  export interface SQLCompiler {
7
+ /** Compile an operation into SQL statements. */
4
8
  compile(operation: MigrationOperation): SQL[];
5
9
  }
@@ -1,17 +1,26 @@
1
1
  import type { MigrationOperation } from '../../domain/MigrationOperation';
2
2
  import type { SQL } from '../contracts/SQL';
3
3
  import type { SQLCompiler } from '../contracts/SQLCompiler';
4
+ /**
5
+ * PostgreSQL SQL compiler for migration operations.
6
+ */
4
7
  export declare class PostgresCompiler implements SQLCompiler {
5
8
  static readonly BRAND: "tango.migrations.postgres_compiler";
6
9
  readonly __tangoBrand: typeof PostgresCompiler.BRAND;
10
+ private readonly sqlSafety;
11
+ /**
12
+ * Narrow an unknown value to the PostgreSQL migration compiler implementation.
13
+ */
7
14
  static isPostgresCompiler(value: unknown): value is PostgresCompiler;
15
+ /**
16
+ * Compile a migration operation into one or more PostgreSQL statements.
17
+ */
8
18
  compile(op: MigrationOperation): SQL[];
9
19
  /**
10
20
  * Compile a DEFAULT value change into ALTER TABLE statements.
11
21
  * Extracted to flatten the nested conditional logic.
12
22
  */
13
23
  private compileDefaultChange;
14
- private id;
15
24
  private colDDL;
16
25
  private typeToSQL;
17
26
  }
@@ -1,10 +1,20 @@
1
1
  import type { MigrationOperation } from '../../domain/MigrationOperation';
2
2
  import type { SQL } from '../contracts/SQL';
3
3
  import type { SQLCompiler } from '../contracts/SQLCompiler';
4
+ /**
5
+ * SQLite SQL compiler for migration operations.
6
+ */
4
7
  export declare class SqliteCompiler implements SQLCompiler {
5
8
  static readonly BRAND: "tango.migrations.sqlite_compiler";
6
9
  readonly __tangoBrand: typeof SqliteCompiler.BRAND;
10
+ private readonly sqlSafety;
11
+ /**
12
+ * Narrow an unknown value to the SQLite migration compiler implementation.
13
+ */
7
14
  static isSqliteCompiler(value: unknown): value is SqliteCompiler;
15
+ /**
16
+ * Compile a migration operation into one or more SQLite statements.
17
+ */
8
18
  compile(op: MigrationOperation): SQL[];
9
19
  private colDDL;
10
20
  }
@@ -1,8 +1,17 @@
1
1
  import type { CompilerFactory } from '../contracts/CompilerFactory';
2
2
  import type { SQLCompiler } from '../contracts/SQLCompiler';
3
+ /**
4
+ * Factory for PostgreSQL migration compilers.
5
+ */
3
6
  export declare class PostgresCompilerFactory implements CompilerFactory {
4
7
  static readonly BRAND: "tango.migrations.postgres_compiler_factory";
5
8
  readonly __tangoBrand: typeof PostgresCompilerFactory.BRAND;
9
+ /**
10
+ * Narrow an unknown value to the factory that provisions PostgreSQL compilers.
11
+ */
6
12
  static isPostgresCompilerFactory(value: unknown): value is PostgresCompilerFactory;
13
+ /**
14
+ * Create a PostgreSQL SQL compiler instance.
15
+ */
7
16
  create(): SQLCompiler;
8
17
  }
@@ -1,8 +1,17 @@
1
1
  import type { CompilerFactory } from '../contracts/CompilerFactory';
2
2
  import type { SQLCompiler } from '../contracts/SQLCompiler';
3
+ /**
4
+ * Factory for SQLite migration compilers.
5
+ */
3
6
  export declare class SqliteCompilerFactory implements CompilerFactory {
4
7
  static readonly BRAND: "tango.migrations.sqlite_compiler_factory";
5
8
  readonly __tangoBrand: typeof SqliteCompilerFactory.BRAND;
9
+ /**
10
+ * Narrow an unknown value to the factory that provisions SQLite compilers.
11
+ */
6
12
  static isSqliteCompilerFactory(value: unknown): value is SqliteCompilerFactory;
13
+ /**
14
+ * Create a SQLite SQL compiler instance.
15
+ */
7
16
  create(): SQLCompiler;
8
17
  }
@@ -1,6 +1,7 @@
1
- import "../InternalOperationKind-BPVoOQwD.js";
2
- import "../InternalColumnType-_YAz7RqI.js";
3
- import { PostgresCompiler, PostgresCompilerFactory, SqliteCompiler, SqliteCompilerFactory } from "../SqliteCompilerFactory-DwMwO7xY.js";
4
- import { contracts_exports$1 as contracts_exports, dialects_exports, factories_exports } from "../compilers-D8DJuTnQ.js";
1
+ import "../InternalOperationKind-Bt6Weuon.js";
2
+ import "../InternalColumnType-G9zV9StN.js";
3
+ import "../MigrationSqlSafetyAdapter-CGRbB2k2.js";
4
+ import { PostgresCompiler, PostgresCompilerFactory, SqliteCompiler, SqliteCompilerFactory } from "../SqliteCompilerFactory-BAodJW9n.js";
5
+ import { contracts_exports$1 as contracts_exports, dialects_exports, factories_exports } from "../compilers-dRN0Hzev.js";
5
6
 
6
7
  export { PostgresCompiler, PostgresCompilerFactory, SqliteCompiler, SqliteCompilerFactory, contracts_exports as contracts, dialects_exports as dialects, factories_exports as factories };
@@ -1,5 +1,5 @@
1
1
  import { __export } from "./chunk-BkvOhyD0.js";
2
- import { PostgresCompiler, PostgresCompilerFactory, SqliteCompiler, SqliteCompilerFactory } from "./SqliteCompilerFactory-DwMwO7xY.js";
2
+ import { PostgresCompiler, PostgresCompilerFactory, SqliteCompiler, SqliteCompilerFactory } from "./SqliteCompilerFactory-BAodJW9n.js";
3
3
 
4
4
  //#region src/compilers/contracts/index.ts
5
5
  var contracts_exports = {};
@@ -35,4 +35,4 @@ __export(compilers_exports, {
35
35
 
36
36
  //#endregion
37
37
  export { compilers_exports, contracts_exports as contracts_exports$1, dialects_exports, factories_exports };
38
- //# sourceMappingURL=compilers-D8DJuTnQ.js.map
38
+ //# sourceMappingURL=compilers-dRN0Hzev.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"compilers-D8DJuTnQ.js","names":[],"sources":["../src/compilers/contracts/index.ts","../src/compilers/dialects/index.ts","../src/compilers/factories/index.ts","../src/compilers/index.ts"],"sourcesContent":["/**\n * Domain boundary barrel: centralizes this subdomain's public contract.\n */\n\nexport type { SQL } from './SQL';\nexport type { SQLCompiler } from './SQLCompiler';\nexport type { CompilerFactory } from './CompilerFactory';\n","/**\n * Domain boundary barrel: centralizes this subdomain's public contract.\n */\n\nexport { PostgresCompiler } from './PostgresCompiler';\nexport { SqliteCompiler } from './SqliteCompiler';\n","/**\n * Domain boundary barrel: centralizes this subdomain's public contract.\n */\n\nexport { PostgresCompilerFactory } from './PostgresCompilerFactory';\nexport { SqliteCompilerFactory } from './SqliteCompilerFactory';\n","/**\n * Domain boundary barrel: exposes namespaced exports for Django-style drill-down\n * imports and curated flat exports for TS-native ergonomics.\n */\n\nexport * as contracts from './contracts/index';\nexport * as dialects from './dialects/index';\nexport * as factories from './factories/index';\n\nexport type { SQL, SQLCompiler, CompilerFactory } from './contracts/index';\nexport { PostgresCompiler, SqliteCompiler } from './dialects/index';\nexport * from './factories/index';\n"],"mappings":""}
1
+ {"version":3,"file":"compilers-dRN0Hzev.js","names":[],"sources":["../src/compilers/contracts/index.ts","../src/compilers/dialects/index.ts","../src/compilers/factories/index.ts","../src/compilers/index.ts"],"sourcesContent":["/**\n * Domain boundary barrel: centralizes this subdomain's public contract.\n */\n\nexport type { SQL } from './SQL';\nexport type { SQLCompiler } from './SQLCompiler';\nexport type { CompilerFactory } from './CompilerFactory';\n","/**\n * Domain boundary barrel: centralizes this subdomain's public contract.\n */\n\nexport { PostgresCompiler } from './PostgresCompiler';\nexport { SqliteCompiler } from './SqliteCompiler';\n","/**\n * Domain boundary barrel: centralizes this subdomain's public contract.\n */\n\nexport { PostgresCompilerFactory } from './PostgresCompilerFactory';\nexport { SqliteCompilerFactory } from './SqliteCompilerFactory';\n","/**\n * Domain boundary barrel: exposes namespaced exports for Django-style drill-down\n * imports and curated flat exports for TS-native ergonomics.\n */\n\nexport * as contracts from './contracts/index';\nexport * as dialects from './dialects/index';\nexport * as factories from './factories/index';\n\nexport type { SQL, SQLCompiler, CompilerFactory } from './contracts/index';\nexport { PostgresCompiler, SqliteCompiler } from './dialects/index';\nexport * from './factories/index';\n"],"mappings":""}
@@ -24,10 +24,15 @@ type ModelIndex = {
24
24
  on: string[];
25
25
  unique?: boolean;
26
26
  };
27
- type ModelMetadataLike = {
27
+ export type ModelMetadataLike = {
28
+ name?: string;
28
29
  table: string;
29
30
  fields: ModelField[];
30
31
  indexes?: ModelIndex[];
31
32
  };
33
+ /**
34
+ * Compare model metadata with an introspected database schema and return the
35
+ * operations needed to bring the database into alignment.
36
+ */
32
37
  export declare function diffSchema(db: DbSchema, models: ModelMetadataLike[]): MigrationOperation[];
33
38
  export {};
@@ -1,8 +1,8 @@
1
- import "../CollectingBuilder-C6qnwyrb.js";
2
- import "../InternalOperationKind-BPVoOQwD.js";
3
- import "../InternalColumnType-_YAz7RqI.js";
4
- import "../builder-Dtk8oP_Y.js";
5
- import { diffSchema } from "../diffSchema-KgGHP-s3.js";
6
- import "../diff-Cs0TPEGR.js";
1
+ import "../CollectingBuilder--4fqDQdE.js";
2
+ import "../InternalOperationKind-Bt6Weuon.js";
3
+ import "../InternalColumnType-G9zV9StN.js";
4
+ import "../builder-xJ-Bq2pk.js";
5
+ import { diffSchema } from "../diffSchema-D4oemTWS.js";
6
+ import "../diff-CZZbXAPN.js";
7
7
 
8
8
  export { diffSchema };
@@ -1,5 +1,5 @@
1
1
  import { __export } from "./chunk-BkvOhyD0.js";
2
- import { diffSchema } from "./diffSchema-KgGHP-s3.js";
2
+ import { diffSchema } from "./diffSchema-D4oemTWS.js";
3
3
 
4
4
  //#region src/diff/index.ts
5
5
  var diff_exports = {};
@@ -7,4 +7,4 @@ __export(diff_exports, { diffSchema: () => diffSchema });
7
7
 
8
8
  //#endregion
9
9
  export { diff_exports };
10
- //# sourceMappingURL=diff-Cs0TPEGR.js.map
10
+ //# sourceMappingURL=diff-CZZbXAPN.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"diff-Cs0TPEGR.js","names":[],"sources":["../src/diff/index.ts"],"sourcesContent":["/**\n * Domain boundary barrel: centralizes this subdomain's public contract.\n */\n\nexport { diffSchema } from './diffSchema';\n"],"mappings":""}
1
+ {"version":3,"file":"diff-CZZbXAPN.js","names":[],"sources":["../src/diff/index.ts"],"sourcesContent":["/**\n * Domain boundary barrel: centralizes this subdomain's public contract.\n */\n\nexport { diffSchema } from './diffSchema';\n"],"mappings":""}
@@ -1,4 +1,5 @@
1
- import { OpBuilder, applyFieldType } from "./builder-Dtk8oP_Y.js";
1
+ import { OpBuilder, applyFieldType } from "./builder-xJ-Bq2pk.js";
2
+ import { trustedSql } from "@danceroutine/tango-core";
2
3
 
3
4
  //#region src/diff/diffSchema.ts
4
5
  function diffSchema(db, models) {
@@ -15,7 +16,7 @@ function diffSchema(db, models) {
15
16
  if (field.notNull) builder = builder.notNull();
16
17
  if (field.default === null) builder = builder.default(null);
17
18
  else if (field.default && typeof field.default === "object" && "now" in field.default) builder = builder.defaultNow();
18
- else if (typeof field.default === "string") builder = builder.default(field.default);
19
+ else if (typeof field.default === "string") builder = builder.default(trustedSql(field.default));
19
20
  if (field.primaryKey) builder = builder.primaryKey();
20
21
  if (field.unique) builder = builder.unique();
21
22
  if (field.references) builder = builder.references(field.references.table, field.references.column, {
@@ -44,7 +45,7 @@ else if (typeof field.default === "string") builder = builder.default(field.defa
44
45
  if (field.notNull) builder = builder.notNull();
45
46
  if (field.default === null) builder = builder.default(null);
46
47
  else if (field.default && typeof field.default === "object" && "now" in field.default) builder = builder.defaultNow();
47
- else if (typeof field.default === "string") builder = builder.default(field.default);
48
+ else if (typeof field.default === "string") builder = builder.default(trustedSql(field.default));
48
49
  if (field.primaryKey) builder = builder.primaryKey();
49
50
  if (field.unique) builder = builder.unique();
50
51
  if (field.references) builder = builder.references(field.references.table, field.references.column, {
@@ -83,4 +84,4 @@ else if (typeof field.default === "string") builder = builder.default(field.defa
83
84
 
84
85
  //#endregion
85
86
  export { diffSchema };
86
- //# sourceMappingURL=diffSchema-KgGHP-s3.js.map
87
+ //# sourceMappingURL=diffSchema-D4oemTWS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diffSchema-D4oemTWS.js","names":["db: DbSchema","models: ModelMetadataLike[]","ops: MigrationOperation[]"],"sources":["../src/diff/diffSchema.ts"],"sourcesContent":["import { trustedSql } from '@danceroutine/tango-core';\nimport type { DbSchema } from '../introspect/PostgresIntrospector';\nimport type { MigrationOperation } from '../domain/MigrationOperation';\nimport type { ColumnType } from '../builder/contracts/ColumnType';\nimport type { DeleteReferentialAction } from '../builder/contracts/DeleteReferentialAction';\nimport type { UpdateReferentialAction } from '../builder/contracts/UpdateReferentialAction';\nimport { op, applyFieldType } from '../builder/index';\n\ntype ModelField = {\n name: string;\n type: ColumnType;\n notNull?: boolean;\n default?: string | { now: true } | null;\n primaryKey?: boolean;\n unique?: boolean;\n references?: {\n table: string;\n column: string;\n onDelete?: DeleteReferentialAction;\n onUpdate?: UpdateReferentialAction;\n };\n};\n\ntype ModelIndex = {\n name: string;\n on: string[];\n unique?: boolean;\n};\n\nexport type ModelMetadataLike = {\n name?: string;\n table: string;\n fields: ModelField[];\n indexes?: ModelIndex[];\n};\n\n/**\n * Compare model metadata with an introspected database schema and return the\n * operations needed to bring the database into alignment.\n */\nexport function diffSchema(db: DbSchema, models: ModelMetadataLike[]): MigrationOperation[] {\n const ops: MigrationOperation[] = [];\n const modelTables = new Set(models.map((model) => model.table));\n const internalTables = new Set(['_tango_migrations']);\n\n models.forEach((model) => {\n const dbTable = db.tables[model.table];\n\n if (!dbTable) {\n ops.push(\n op.table(model.table).create((cols) => {\n model.fields.forEach((field) => {\n cols.add(field.name, (builder) => {\n builder = applyFieldType(builder, field.type);\n\n if (field.notNull) {\n builder = builder.notNull();\n }\n\n if (field.default === null) {\n builder = builder.default(null);\n } else if (field.default && typeof field.default === 'object' && 'now' in field.default) {\n builder = builder.defaultNow();\n } else if (typeof field.default === 'string') {\n builder = builder.default(trustedSql(field.default));\n }\n\n if (field.primaryKey) {\n builder = builder.primaryKey();\n }\n\n if (field.unique) {\n builder = builder.unique();\n }\n\n if (field.references) {\n builder = builder.references(field.references.table, field.references.column, {\n onDelete: field.references.onDelete,\n onUpdate: field.references.onUpdate,\n });\n }\n\n return builder;\n });\n });\n })\n );\n\n (model.indexes ?? []).forEach((index) => {\n ops.push(\n op.index.create({\n name: index.name,\n table: model.table,\n on: index.on,\n unique: !!index.unique,\n })\n );\n });\n return;\n }\n\n const modelFieldNames = new Set(model.fields.map((field) => field.name));\n const dbFieldNames = new Set(Object.keys(dbTable.columns));\n\n model.fields.forEach((field) => {\n if (!dbFieldNames.has(field.name)) {\n ops.push(\n op.table(model.table).addColumn(field.name, (builder) => {\n builder = applyFieldType(builder, field.type);\n\n if (field.notNull) {\n builder = builder.notNull();\n }\n if (field.default === null) {\n builder = builder.default(null);\n } else if (field.default && typeof field.default === 'object' && 'now' in field.default) {\n builder = builder.defaultNow();\n } else if (typeof field.default === 'string') {\n builder = builder.default(trustedSql(field.default));\n }\n if (field.primaryKey) {\n builder = builder.primaryKey();\n }\n if (field.unique) {\n builder = builder.unique();\n }\n if (field.references) {\n builder = builder.references(field.references.table, field.references.column, {\n onDelete: field.references.onDelete,\n onUpdate: field.references.onUpdate,\n });\n }\n\n return builder;\n })\n );\n }\n });\n\n dbFieldNames.forEach((dbColumnName) => {\n if (!modelFieldNames.has(dbColumnName)) {\n ops.push(op.table(model.table).dropColumn(dbColumnName));\n }\n });\n\n const modelIndexes = new Map((model.indexes ?? []).map((index) => [index.name, index] as const));\n const dbIndexNames = new Set(Object.keys(dbTable.indexes));\n\n modelIndexes.forEach((index, indexName) => {\n if (!dbIndexNames.has(indexName)) {\n ops.push(\n op.index.create({\n name: index.name,\n table: model.table,\n on: index.on,\n unique: !!index.unique,\n })\n );\n }\n });\n\n dbIndexNames.forEach((dbIndexName) => {\n if (!modelIndexes.has(dbIndexName)) {\n ops.push(\n op.index.drop({\n name: dbIndexName,\n table: model.table,\n })\n );\n }\n });\n });\n\n Object.keys(db.tables).forEach((dbTableName) => {\n if (internalTables.has(dbTableName)) {\n return;\n }\n if (!modelTables.has(dbTableName)) {\n ops.push(op.table(dbTableName).drop());\n }\n });\n\n return ops;\n}\n"],"mappings":"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"}
@@ -1,12 +1,29 @@
1
1
  import type { Builder } from '../builder/contracts/Builder';
2
2
  import type { MigrationMode } from './MigrationMode';
3
+ /**
4
+ * Base migration contract.
5
+ *
6
+ * Concrete migrations provide a stable `id` and define reversible schema/data
7
+ * operations through `up` and `down`.
8
+ */
3
9
  export declare abstract class Migration {
4
10
  static readonly BRAND: "tango.migration";
11
+ static readonly CONSTRUCTOR_BRAND: "tango.migration.constructor";
12
+ static readonly __tangoConstructorBrand: typeof Migration.CONSTRUCTOR_BRAND;
5
13
  readonly __tangoBrand: typeof Migration.BRAND;
6
14
  abstract id: string;
15
+ /** Optional execution mode override (`online`/`offline`). */
7
16
  mode?: MigrationMode;
17
+ /** Apply migration operations. */
8
18
  abstract up(m: Builder): void | Promise<void>;
19
+ /** Revert migration operations. */
9
20
  abstract down(m: Builder): void | Promise<void>;
21
+ /**
22
+ * Narrow an unknown value to a migration instance.
23
+ */
10
24
  static isMigration(value: unknown): value is Migration;
25
+ /**
26
+ * Narrow an unknown value to a migration constructor.
27
+ */
11
28
  static isMigrationConstructor(value: unknown): value is new () => Migration;
12
29
  }
@@ -1,54 +1,55 @@
1
- import type { InternalOperationKind } from './internal/InternalOperationKind';
1
+ import type { TrustedSqlFragment } from '@danceroutine/tango-core';
2
+ import { InternalOperationKind } from './internal/InternalOperationKind';
2
3
  import type { ColumnSpec } from '../builder/contracts/ColumnSpec';
3
4
  export type TableCreate = {
4
- kind: InternalOperationKind.TABLE_CREATE;
5
+ kind: typeof InternalOperationKind.TABLE_CREATE;
5
6
  table: string;
6
7
  columns: ColumnSpec[];
7
8
  };
8
9
  export type TableDrop = {
9
- kind: InternalOperationKind.TABLE_DROP;
10
+ kind: typeof InternalOperationKind.TABLE_DROP;
10
11
  table: string;
11
12
  cascade?: boolean;
12
13
  };
13
14
  export type ColumnAdd = {
14
- kind: InternalOperationKind.COLUMN_ADD;
15
+ kind: typeof InternalOperationKind.COLUMN_ADD;
15
16
  table: string;
16
17
  column: ColumnSpec;
17
18
  };
18
19
  export type ColumnDrop = {
19
- kind: InternalOperationKind.COLUMN_DROP;
20
+ kind: typeof InternalOperationKind.COLUMN_DROP;
20
21
  table: string;
21
22
  column: string;
22
23
  };
23
24
  export type ColumnAlter = {
24
- kind: InternalOperationKind.COLUMN_ALTER;
25
+ kind: typeof InternalOperationKind.COLUMN_ALTER;
25
26
  table: string;
26
27
  column: string;
27
28
  to: Partial<ColumnSpec>;
28
29
  };
29
30
  export type ColumnRename = {
30
- kind: InternalOperationKind.COLUMN_RENAME;
31
+ kind: typeof InternalOperationKind.COLUMN_RENAME;
31
32
  table: string;
32
33
  from: string;
33
34
  to: string;
34
35
  };
35
36
  export type IndexCreate = {
36
- kind: InternalOperationKind.INDEX_CREATE;
37
+ kind: typeof InternalOperationKind.INDEX_CREATE;
37
38
  table: string;
38
39
  name: string;
39
40
  on: string[];
40
41
  unique?: boolean;
41
- where?: string;
42
+ where?: TrustedSqlFragment;
42
43
  concurrently?: boolean;
43
44
  };
44
45
  export type IndexDrop = {
45
- kind: InternalOperationKind.INDEX_DROP;
46
+ kind: typeof InternalOperationKind.INDEX_DROP;
46
47
  table: string;
47
48
  name: string;
48
49
  concurrently?: boolean;
49
50
  };
50
51
  export type ForeignKeyCreate = {
51
- kind: InternalOperationKind.FK_CREATE;
52
+ kind: typeof InternalOperationKind.FK_CREATE;
52
53
  table: string;
53
54
  name?: string;
54
55
  columns: string[];
@@ -59,12 +60,12 @@ export type ForeignKeyCreate = {
59
60
  notValid?: boolean;
60
61
  };
61
62
  export type ForeignKeyValidate = {
62
- kind: InternalOperationKind.FK_VALIDATE;
63
+ kind: typeof InternalOperationKind.FK_VALIDATE;
63
64
  table: string;
64
65
  name: string;
65
66
  };
66
67
  export type ForeignKeyDrop = {
67
- kind: InternalOperationKind.FK_DROP;
68
+ kind: typeof InternalOperationKind.FK_DROP;
68
69
  table: string;
69
70
  name: string;
70
71
  };
@@ -1,4 +1,4 @@
1
- import { Migration } from "../Migration-D9J6ZbLP.js";
2
- import "../domain-BXVlG0C0.js";
1
+ import { Migration } from "../Migration-DYQ0hUG7.js";
2
+ import "../domain-CwR-kUNS.js";
3
3
 
4
4
  export { Migration };
@@ -1,10 +1,11 @@
1
- export declare enum InternalColumnType {
2
- SERIAL = "serial",
3
- INT = "int",
4
- BIGINT = "bigint",
5
- TEXT = "text",
6
- BOOL = "bool",
7
- TIMESTAMPTZ = "timestamptz",
8
- JSONB = "jsonb",
9
- UUID = "uuid"
10
- }
1
+ export declare const InternalColumnType: {
2
+ readonly SERIAL: "serial";
3
+ readonly INT: "int";
4
+ readonly BIGINT: "bigint";
5
+ readonly TEXT: "text";
6
+ readonly BOOL: "bool";
7
+ readonly TIMESTAMPTZ: "timestamptz";
8
+ readonly JSONB: "jsonb";
9
+ readonly UUID: "uuid";
10
+ };
11
+ export type InternalColumnType = (typeof InternalColumnType)[keyof typeof InternalColumnType];
@@ -1,4 +1,5 @@
1
- export declare enum InternalDialect {
2
- POSTGRES = "postgres",
3
- SQLITE = "sqlite"
4
- }
1
+ export declare const InternalDialect: {
2
+ readonly POSTGRES: "postgres";
3
+ readonly SQLITE: "sqlite";
4
+ };
5
+ export type InternalDialect = (typeof InternalDialect)[keyof typeof InternalDialect];
@@ -1,4 +1,5 @@
1
- export declare enum InternalMigrationMode {
2
- TRANSACTIONAL = "transactional",
3
- ONLINE = "online"
4
- }
1
+ export declare const InternalMigrationMode: {
2
+ readonly TRANSACTIONAL: "transactional";
3
+ readonly ONLINE: "online";
4
+ };
5
+ export type InternalMigrationMode = (typeof InternalMigrationMode)[keyof typeof InternalMigrationMode];
@@ -1,13 +1,14 @@
1
- export declare enum InternalOperationKind {
2
- TABLE_CREATE = "table.create",
3
- TABLE_DROP = "table.drop",
4
- COLUMN_ADD = "column.add",
5
- COLUMN_DROP = "column.drop",
6
- COLUMN_ALTER = "column.alter",
7
- COLUMN_RENAME = "column.rename",
8
- INDEX_CREATE = "index.create",
9
- INDEX_DROP = "index.drop",
10
- FK_CREATE = "fk.create",
11
- FK_VALIDATE = "fk.validate",
12
- FK_DROP = "fk.drop"
13
- }
1
+ export declare const InternalOperationKind: {
2
+ readonly TABLE_CREATE: "table.create";
3
+ readonly TABLE_DROP: "table.drop";
4
+ readonly COLUMN_ADD: "column.add";
5
+ readonly COLUMN_DROP: "column.drop";
6
+ readonly COLUMN_ALTER: "column.alter";
7
+ readonly COLUMN_RENAME: "column.rename";
8
+ readonly INDEX_CREATE: "index.create";
9
+ readonly INDEX_DROP: "index.drop";
10
+ readonly FK_CREATE: "fk.create";
11
+ readonly FK_VALIDATE: "fk.validate";
12
+ readonly FK_DROP: "fk.drop";
13
+ };
14
+ export type InternalOperationKind = (typeof InternalOperationKind)[keyof typeof InternalOperationKind];
@@ -1,6 +1,7 @@
1
- export declare enum InternalReferentialAction {
2
- CASCADE = "CASCADE",
3
- SET_NULL = "SET NULL",
4
- RESTRICT = "RESTRICT",
5
- NO_ACTION = "NO ACTION"
6
- }
1
+ export declare const InternalReferentialAction: {
2
+ readonly CASCADE: "CASCADE";
3
+ readonly SET_NULL: "SET NULL";
4
+ readonly RESTRICT: "RESTRICT";
5
+ readonly NO_ACTION: "NO ACTION";
6
+ };
7
+ export type InternalReferentialAction = (typeof InternalReferentialAction)[keyof typeof InternalReferentialAction];
@@ -1,5 +1,5 @@
1
1
  import { __export } from "./chunk-BkvOhyD0.js";
2
- import { Migration } from "./Migration-D9J6ZbLP.js";
2
+ import { Migration } from "./Migration-DYQ0hUG7.js";
3
3
 
4
4
  //#region src/domain/index.ts
5
5
  var domain_exports = {};
@@ -7,4 +7,4 @@ __export(domain_exports, { Migration: () => Migration });
7
7
 
8
8
  //#endregion
9
9
  export { domain_exports };
10
- //# sourceMappingURL=domain-BXVlG0C0.js.map
10
+ //# sourceMappingURL=domain-CwR-kUNS.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"domain-BXVlG0C0.js","names":[],"sources":["../src/domain/index.ts"],"sourcesContent":["/**\n * Domain boundary barrel: centralizes this subdomain's public contract.\n */\n\nexport type { Dialect } from './Dialect';\nexport { Migration } from './Migration';\nexport type { MigrationMode } from './MigrationMode';\nexport type { MigrationOperation } from './MigrationOperation';\n"],"mappings":""}
1
+ {"version":3,"file":"domain-CwR-kUNS.js","names":[],"sources":["../src/domain/index.ts"],"sourcesContent":["/**\n * Domain boundary barrel: centralizes this subdomain's public contract.\n */\n\nexport type { Dialect } from './Dialect';\nexport { Migration } from './Migration';\nexport type { MigrationMode } from './MigrationMode';\nexport type { MigrationOperation } from './MigrationOperation';\n"],"mappings":""}
@@ -1,12 +1,24 @@
1
1
  import type { MigrationOperation } from '../domain/MigrationOperation';
2
+ /**
3
+ * Input contract for generating a migration source file.
4
+ */
2
5
  export interface GenerateMigrationOptions {
6
+ /** Human-readable suffix used in file name/id generation. */
3
7
  name: string;
8
+ /** Ordered migration operations to render. */
4
9
  operations: MigrationOperation[];
10
+ /** Output directory for generated migration files. */
5
11
  directory: string;
6
12
  }
13
+ /**
14
+ * Source generator for class-based migration files.
15
+ */
7
16
  export declare class MigrationGenerator {
8
17
  static readonly BRAND: "tango.migrations.generator";
9
18
  readonly __tangoBrand: typeof MigrationGenerator.BRAND;
19
+ /**
20
+ * Narrow an unknown value to `MigrationGenerator`.
21
+ */
10
22
  static isMigrationGenerator(value: unknown): value is MigrationGenerator;
11
23
  /**
12
24
  * Generate a migration file and write it to disk.
@@ -32,4 +44,5 @@ export declare class MigrationGenerator {
32
44
  private renderForeignKeyDrop;
33
45
  private renderColumnChain;
34
46
  private timestamp;
47
+ private isNowDefault;
35
48
  }
@@ -1,5 +1,5 @@
1
- import "../InternalOperationKind-BPVoOQwD.js";
2
- import { MigrationGenerator } from "../MigrationGenerator-Z39LTKmC.js";
3
- import "../generator-3yC60b1u.js";
1
+ import "../InternalOperationKind-Bt6Weuon.js";
2
+ import { MigrationGenerator } from "../MigrationGenerator-B1p0jHnx.js";
3
+ import "../generator-DK-_f-PF.js";
4
4
 
5
5
  export { MigrationGenerator };
@@ -1,5 +1,5 @@
1
1
  import { __export } from "./chunk-BkvOhyD0.js";
2
- import { MigrationGenerator } from "./MigrationGenerator-Z39LTKmC.js";
2
+ import { MigrationGenerator } from "./MigrationGenerator-B1p0jHnx.js";
3
3
 
4
4
  //#region src/generator/index.ts
5
5
  var generator_exports = {};
@@ -7,4 +7,4 @@ __export(generator_exports, { MigrationGenerator: () => MigrationGenerator });
7
7
 
8
8
  //#endregion
9
9
  export { generator_exports };
10
- //# sourceMappingURL=generator-3yC60b1u.js.map
10
+ //# sourceMappingURL=generator-DK-_f-PF.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"generator-3yC60b1u.js","names":[],"sources":["../src/generator/index.ts"],"sourcesContent":["/**\n * Domain boundary barrel: centralizes this subdomain's public contract.\n */\n\nexport { MigrationGenerator, type GenerateMigrationOptions } from './MigrationGenerator';\n"],"mappings":""}
1
+ {"version":3,"file":"generator-DK-_f-PF.js","names":[],"sources":["../src/generator/index.ts"],"sourcesContent":["/**\n * Domain boundary barrel: centralizes this subdomain's public contract.\n */\n\nexport { MigrationGenerator, type GenerateMigrationOptions } from './MigrationGenerator';\n"],"mappings":""}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ export { trustedSql } from '@danceroutine/tango-core';
2
+ export type { TrustedSqlFragment } from '@danceroutine/tango-core';
1
3
  /**
2
4
  * Bundled exports for Django-style domain drill-down imports, plus curated
3
5
  * top-level symbols for TS-native ergonomic imports.
@@ -10,6 +12,7 @@ export * as diff from './diff/index';
10
12
  export * as compilers from './compilers/index';
11
13
  export * as introspect from './introspect/index';
12
14
  export * as strategies from './strategies/index';
15
+ export * as commands from './commands/index';
13
16
  export { Migration } from './domain/index';
14
17
  export type { Dialect, MigrationMode, MigrationOperation } from './domain/index';
15
18
  export type { Builder, ColumnSpec, ColumnType, DeleteReferentialAction, UpdateReferentialAction, } from './builder/index';
@@ -20,4 +23,5 @@ export { diffSchema } from './diff/index';
20
23
  export { PostgresCompiler, SqliteCompiler } from './compilers/index';
21
24
  export type { CompilerFactory, SQL, SQLCompiler } from './compilers/index';
22
25
  export { CompilerStrategy, IntrospectorStrategy, createDefaultCompilerStrategy, createDefaultIntrospectorStrategy, } from './strategies/index';
26
+ export { registerMigrationsCommands } from './commands/index';
23
27
  export { PostgresIntrospector, SqliteIntrospector, type DatabaseIntrospector, type DBClient, type PostgresDbColumn, type PostgresDbForeignKey, type PostgresDbIndex, type PostgresDbSchema, type PostgresDbTable, type SqliteDbColumn, type SqliteDbSchema, type SqliteDbTable, } from './introspect/index';
package/dist/index.js CHANGED
@@ -1,21 +1,25 @@
1
- import { CollectingBuilder } from "./CollectingBuilder-C6qnwyrb.js";
2
- import { Migration } from "./Migration-D9J6ZbLP.js";
3
- import "./InternalOperationKind-BPVoOQwD.js";
4
- import "./InternalColumnType-_YAz7RqI.js";
5
- import { PostgresCompiler, SqliteCompiler } from "./SqliteCompilerFactory-DwMwO7xY.js";
6
- import { CompilerStrategy, createDefaultCompilerStrategy } from "./CompilerStrategy-Cv1woBmO.js";
7
- import { MigrationRunner } from "./MigrationRunner-CCFuPUlr.js";
8
- import { MigrationGenerator } from "./MigrationGenerator-Z39LTKmC.js";
9
- import { OpBuilder, applyFieldType, builder_exports } from "./builder-Dtk8oP_Y.js";
10
- import { diffSchema } from "./diffSchema-KgGHP-s3.js";
11
- import { PostgresIntrospector, SqliteIntrospector } from "./SqliteIntrospector-BRdNt6KG.js";
12
- import { IntrospectorStrategy, createDefaultIntrospectorStrategy } from "./IntrospectorStrategy-BM1Eizfc.js";
13
- import { domain_exports } from "./domain-BXVlG0C0.js";
14
- import { runner_exports } from "./runner-BOs-tItW.js";
15
- import { generator_exports } from "./generator-3yC60b1u.js";
16
- import { diff_exports } from "./diff-Cs0TPEGR.js";
17
- import { compilers_exports } from "./compilers-D8DJuTnQ.js";
18
- import { introspect_exports } from "./introspect-ks-QSodq.js";
19
- import { strategies_exports } from "./strategies-BvHwf4as.js";
1
+ import { CollectingBuilder } from "./CollectingBuilder--4fqDQdE.js";
2
+ import { Migration } from "./Migration-DYQ0hUG7.js";
3
+ import "./InternalOperationKind-Bt6Weuon.js";
4
+ import "./InternalColumnType-G9zV9StN.js";
5
+ import "./MigrationSqlSafetyAdapter-CGRbB2k2.js";
6
+ import { PostgresCompiler, SqliteCompiler } from "./SqliteCompilerFactory-BAodJW9n.js";
7
+ import { CompilerStrategy, createDefaultCompilerStrategy } from "./CompilerStrategy-yKw-Egxv.js";
8
+ import { MigrationRunner } from "./MigrationRunner-D1ZfbbS-.js";
9
+ import { MigrationGenerator } from "./MigrationGenerator-B1p0jHnx.js";
10
+ import { OpBuilder, applyFieldType, builder_exports } from "./builder-xJ-Bq2pk.js";
11
+ import { diffSchema } from "./diffSchema-D4oemTWS.js";
12
+ import { PostgresIntrospector, SqliteIntrospector } from "./SqliteIntrospector-CWwPWhmA.js";
13
+ import { IntrospectorStrategy, createDefaultIntrospectorStrategy } from "./IntrospectorStrategy-blvwSU3_.js";
14
+ import { registerMigrationsCommands } from "./cli-DhCn8xiS.js";
15
+ import { domain_exports } from "./domain-CwR-kUNS.js";
16
+ import { runner_exports } from "./runner-C97xT8_W.js";
17
+ import { generator_exports } from "./generator-DK-_f-PF.js";
18
+ import { diff_exports } from "./diff-CZZbXAPN.js";
19
+ import { compilers_exports } from "./compilers-dRN0Hzev.js";
20
+ import { introspect_exports } from "./introspect-TPv_jeD6.js";
21
+ import { strategies_exports } from "./strategies-D9ymSvbG.js";
22
+ import { commands_exports } from "./commands-DIJepqNg.js";
23
+ import { trustedSql } from "@danceroutine/tango-core";
20
24
 
21
- export { CollectingBuilder, CompilerStrategy, IntrospectorStrategy, Migration, MigrationGenerator, MigrationRunner, OpBuilder, PostgresCompiler, PostgresIntrospector, SqliteCompiler, SqliteIntrospector, applyFieldType, builder_exports as builder, compilers_exports as compilers, createDefaultCompilerStrategy, createDefaultIntrospectorStrategy, diff_exports as diff, diffSchema, domain_exports as domain, generator_exports as generator, introspect_exports as introspect, OpBuilder as op, runner_exports as runner, strategies_exports as strategies };
25
+ export { CollectingBuilder, CompilerStrategy, IntrospectorStrategy, Migration, MigrationGenerator, MigrationRunner, OpBuilder, PostgresCompiler, PostgresIntrospector, SqliteCompiler, SqliteIntrospector, applyFieldType, builder_exports as builder, commands_exports as commands, compilers_exports as compilers, createDefaultCompilerStrategy, createDefaultIntrospectorStrategy, diff_exports as diff, diffSchema, domain_exports as domain, generator_exports as generator, introspect_exports as introspect, OpBuilder as op, registerMigrationsCommands, runner_exports as runner, strategies_exports as strategies, trustedSql };