drizzle-kit 0.25.0-b8bf113 → 0.25.0-bbca092
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/api.d.mts +805 -3
- package/api.d.ts +805 -3
- package/api.js +3531 -1253
- package/api.mjs +3531 -1253
- package/bin.cjs +3202 -837
- package/common-DYjgLS6u.d.mts +8 -0
- package/common-DYjgLS6u.d.ts +8 -0
- package/index.d.mts +2 -5
- package/index.d.ts +2 -5
- package/package.json +2 -2
- package/utils.js +113 -18
- package/utils.mjs +112 -18
    
        package/utils.mjs
    CHANGED
    
    | @@ -410,8 +410,8 @@ var require_hanji = __commonJS({ | |
| 410 410 | 
             
                };
         | 
| 411 411 | 
             
                exports.deferred = deferred;
         | 
| 412 412 | 
             
                var Terminal = class {
         | 
| 413 | 
            -
                  constructor( | 
| 414 | 
            -
                    this.view =  | 
| 413 | 
            +
                  constructor(view4, stdin, stdout, closable) {
         | 
| 414 | 
            +
                    this.view = view4;
         | 
| 415 415 | 
             
                    this.stdin = stdin;
         | 
| 416 416 | 
             
                    this.stdout = stdout;
         | 
| 417 417 | 
             
                    this.closable = closable;
         | 
| @@ -449,7 +449,7 @@ var require_hanji = __commonJS({ | |
| 449 449 | 
             
                        this.resolve({ status: "submitted", data: this.view.result() });
         | 
| 450 450 | 
             
                        return;
         | 
| 451 451 | 
             
                      }
         | 
| 452 | 
            -
                       | 
| 452 | 
            +
                      view4.input(str, key);
         | 
| 453 453 | 
             
                    };
         | 
| 454 454 | 
             
                    this.stdin.on("keypress", keypress);
         | 
| 455 455 | 
             
                    this.view.attach(this);
         | 
| @@ -511,8 +511,8 @@ var require_hanji = __commonJS({ | |
| 511 511 | 
             
                };
         | 
| 512 512 | 
             
                exports.TaskView = TaskView2;
         | 
| 513 513 | 
             
                var TaskTerminal = class {
         | 
| 514 | 
            -
                  constructor( | 
| 515 | 
            -
                    this.view =  | 
| 514 | 
            +
                  constructor(view4, stdout) {
         | 
| 515 | 
            +
                    this.view = view4;
         | 
| 516 516 | 
             
                    this.stdout = stdout;
         | 
| 517 517 | 
             
                    this.text = "";
         | 
| 518 518 | 
             
                    this.view.attach(this);
         | 
| @@ -531,22 +531,22 @@ var require_hanji = __commonJS({ | |
| 531 531 | 
             
                  }
         | 
| 532 532 | 
             
                };
         | 
| 533 533 | 
             
                exports.TaskTerminal = TaskTerminal;
         | 
| 534 | 
            -
                function render2( | 
| 534 | 
            +
                function render2(view4) {
         | 
| 535 535 | 
             
                  const { stdin, stdout, closable } = (0, readline_1.prepareReadLine)();
         | 
| 536 | 
            -
                  if ( | 
| 537 | 
            -
                    const terminal = new Terminal( | 
| 536 | 
            +
                  if (view4 instanceof Prompt2) {
         | 
| 537 | 
            +
                    const terminal = new Terminal(view4, stdin, stdout, closable);
         | 
| 538 538 | 
             
                    terminal.requestLayout();
         | 
| 539 539 | 
             
                    return terminal.result();
         | 
| 540 540 | 
             
                  }
         | 
| 541 | 
            -
                  stdout.write(`${ | 
| 541 | 
            +
                  stdout.write(`${view4}
         | 
| 542 542 | 
             
            `);
         | 
| 543 543 | 
             
                  closable.close();
         | 
| 544 544 | 
             
                  return;
         | 
| 545 545 | 
             
                }
         | 
| 546 546 | 
             
                exports.render = render2;
         | 
| 547 | 
            -
                function renderWithTask( | 
| 547 | 
            +
                function renderWithTask(view4, task) {
         | 
| 548 548 | 
             
                  return __awaiter(this, void 0, void 0, function* () {
         | 
| 549 | 
            -
                    const terminal = new TaskTerminal( | 
| 549 | 
            +
                    const terminal = new TaskTerminal(view4, process.stdout);
         | 
| 550 550 | 
             
                    terminal.requestLayout();
         | 
| 551 551 | 
             
                    const result = yield task;
         | 
| 552 552 | 
             
                    terminal.clear();
         | 
| @@ -1052,6 +1052,7 @@ var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 }); | |
| 1052 1052 | 
             
            var source_default = chalk;
         | 
| 1053 1053 |  | 
| 1054 1054 | 
             
            // src/utils.ts
         | 
| 1055 | 
            +
            import { toCamelCase, toSnakeCase } from "drizzle-orm/casing";
         | 
| 1055 1056 | 
             
            import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from "fs";
         | 
| 1056 1057 | 
             
            import { join } from "path";
         | 
| 1057 1058 | 
             
            import { parse } from "url";
         | 
| @@ -4880,6 +4881,10 @@ var uniqueConstraint = objectType({ | |
| 4880 4881 | 
             
              name: stringType(),
         | 
| 4881 4882 | 
             
              columns: stringType().array()
         | 
| 4882 4883 | 
             
            }).strict();
         | 
| 4884 | 
            +
            var checkConstraint = objectType({
         | 
| 4885 | 
            +
              name: stringType(),
         | 
| 4886 | 
            +
              value: stringType()
         | 
| 4887 | 
            +
            }).strict();
         | 
| 4883 4888 | 
             
            var tableV4 = objectType({
         | 
| 4884 4889 | 
             
              name: stringType(),
         | 
| 4885 4890 | 
             
              schema: stringType().optional(),
         | 
| @@ -4893,8 +4898,20 @@ var table = objectType({ | |
| 4893 4898 | 
             
              indexes: recordType(stringType(), index),
         | 
| 4894 4899 | 
             
              foreignKeys: recordType(stringType(), fk),
         | 
| 4895 4900 | 
             
              compositePrimaryKeys: recordType(stringType(), compositePK),
         | 
| 4896 | 
            -
              uniqueConstraints: recordType(stringType(), uniqueConstraint).default({})
         | 
| 4901 | 
            +
              uniqueConstraints: recordType(stringType(), uniqueConstraint).default({}),
         | 
| 4902 | 
            +
              checkConstraint: recordType(stringType(), checkConstraint).default({})
         | 
| 4903 | 
            +
            }).strict();
         | 
| 4904 | 
            +
            var viewMeta = objectType({
         | 
| 4905 | 
            +
              algorithm: enumType(["undefined", "merge", "temptable"]),
         | 
| 4906 | 
            +
              sqlSecurity: enumType(["definer", "invoker"]),
         | 
| 4907 | 
            +
              withCheckOption: enumType(["local", "cascaded"]).optional()
         | 
| 4897 4908 | 
             
            }).strict();
         | 
| 4909 | 
            +
            var view = objectType({
         | 
| 4910 | 
            +
              name: stringType(),
         | 
| 4911 | 
            +
              columns: recordType(stringType(), column),
         | 
| 4912 | 
            +
              definition: stringType().optional(),
         | 
| 4913 | 
            +
              isExisting: booleanType()
         | 
| 4914 | 
            +
            }).strict().merge(viewMeta);
         | 
| 4898 4915 | 
             
            var kitInternals = objectType({
         | 
| 4899 4916 | 
             
              tables: recordType(
         | 
| 4900 4917 | 
             
                stringType(),
         | 
| @@ -4947,6 +4964,7 @@ var schemaInternal = objectType({ | |
| 4947 4964 | 
             
              version: literalType("5"),
         | 
| 4948 4965 | 
             
              dialect,
         | 
| 4949 4966 | 
             
              tables: recordType(stringType(), table),
         | 
| 4967 | 
            +
              views: recordType(stringType(), view),
         | 
| 4950 4968 | 
             
              _meta: objectType({
         | 
| 4951 4969 | 
             
                tables: recordType(stringType(), stringType()),
         | 
| 4952 4970 | 
             
                columns: recordType(stringType(), stringType())
         | 
| @@ -4970,12 +4988,19 @@ var tableSquashed = objectType({ | |
| 4970 4988 | 
             
              indexes: recordType(stringType(), stringType()),
         | 
| 4971 4989 | 
             
              foreignKeys: recordType(stringType(), stringType()),
         | 
| 4972 4990 | 
             
              compositePrimaryKeys: recordType(stringType(), stringType()),
         | 
| 4973 | 
            -
              uniqueConstraints: recordType(stringType(), stringType()).default({})
         | 
| 4991 | 
            +
              uniqueConstraints: recordType(stringType(), stringType()).default({}),
         | 
| 4992 | 
            +
              checkConstraints: recordType(stringType(), stringType()).default({})
         | 
| 4974 4993 | 
             
            }).strict();
         | 
| 4994 | 
            +
            var viewSquashed = view.omit({
         | 
| 4995 | 
            +
              algorithm: true,
         | 
| 4996 | 
            +
              sqlSecurity: true,
         | 
| 4997 | 
            +
              withCheckOption: true
         | 
| 4998 | 
            +
            }).extend({ meta: stringType() });
         | 
| 4975 4999 | 
             
            var schemaSquashed = objectType({
         | 
| 4976 5000 | 
             
              version: literalType("5"),
         | 
| 4977 5001 | 
             
              dialect,
         | 
| 4978 | 
            -
              tables: recordType(stringType(), tableSquashed)
         | 
| 5002 | 
            +
              tables: recordType(stringType(), tableSquashed),
         | 
| 5003 | 
            +
              views: recordType(stringType(), viewSquashed)
         | 
| 4979 5004 | 
             
            }).strict();
         | 
| 4980 5005 | 
             
            var schemaSquashedV4 = objectType({
         | 
| 4981 5006 | 
             
              version: literalType("4"),
         | 
| @@ -4993,6 +5018,7 @@ var dryMySql = mysqlSchema.parse({ | |
| 4993 5018 | 
             
              prevId: "",
         | 
| 4994 5019 | 
             
              tables: {},
         | 
| 4995 5020 | 
             
              schemas: {},
         | 
| 5021 | 
            +
              views: {},
         | 
| 4996 5022 | 
             
              _meta: {
         | 
| 4997 5023 | 
             
                schemas: {},
         | 
| 4998 5024 | 
             
                tables: {},
         | 
| @@ -5158,6 +5184,10 @@ var column2 = objectType({ | |
| 5158 5184 | 
             
              }).optional(),
         | 
| 5159 5185 | 
             
              identity: sequenceSchema.merge(objectType({ type: enumType(["always", "byDefault"]) })).optional()
         | 
| 5160 5186 | 
             
            }).strict();
         | 
| 5187 | 
            +
            var checkConstraint2 = objectType({
         | 
| 5188 | 
            +
              name: stringType(),
         | 
| 5189 | 
            +
              value: stringType()
         | 
| 5190 | 
            +
            }).strict();
         | 
| 5161 5191 | 
             
            var columnSquashed = objectType({
         | 
| 5162 5192 | 
             
              name: stringType(),
         | 
| 5163 5193 | 
             
              type: stringType(),
         | 
| @@ -5189,6 +5219,44 @@ var uniqueConstraint2 = objectType({ | |
| 5189 5219 | 
             
              columns: stringType().array(),
         | 
| 5190 5220 | 
             
              nullsNotDistinct: booleanType()
         | 
| 5191 5221 | 
             
            }).strict();
         | 
| 5222 | 
            +
            var viewWithOption = objectType({
         | 
| 5223 | 
            +
              checkOption: enumType(["local", "cascaded"]).optional(),
         | 
| 5224 | 
            +
              securityBarrier: booleanType().optional(),
         | 
| 5225 | 
            +
              securityInvoker: booleanType().optional()
         | 
| 5226 | 
            +
            }).strict();
         | 
| 5227 | 
            +
            var matViewWithOption = objectType({
         | 
| 5228 | 
            +
              fillfactor: numberType().optional(),
         | 
| 5229 | 
            +
              toastTupleTarget: numberType().optional(),
         | 
| 5230 | 
            +
              parallelWorkers: numberType().optional(),
         | 
| 5231 | 
            +
              autovacuumEnabled: booleanType().optional(),
         | 
| 5232 | 
            +
              vacuumIndexCleanup: enumType(["auto", "off", "on"]).optional(),
         | 
| 5233 | 
            +
              vacuumTruncate: booleanType().optional(),
         | 
| 5234 | 
            +
              autovacuumVacuumThreshold: numberType().optional(),
         | 
| 5235 | 
            +
              autovacuumVacuumScaleFactor: numberType().optional(),
         | 
| 5236 | 
            +
              autovacuumVacuumCostDelay: numberType().optional(),
         | 
| 5237 | 
            +
              autovacuumVacuumCostLimit: numberType().optional(),
         | 
| 5238 | 
            +
              autovacuumFreezeMinAge: numberType().optional(),
         | 
| 5239 | 
            +
              autovacuumFreezeMaxAge: numberType().optional(),
         | 
| 5240 | 
            +
              autovacuumFreezeTableAge: numberType().optional(),
         | 
| 5241 | 
            +
              autovacuumMultixactFreezeMinAge: numberType().optional(),
         | 
| 5242 | 
            +
              autovacuumMultixactFreezeMaxAge: numberType().optional(),
         | 
| 5243 | 
            +
              autovacuumMultixactFreezeTableAge: numberType().optional(),
         | 
| 5244 | 
            +
              logAutovacuumMinDuration: numberType().optional(),
         | 
| 5245 | 
            +
              userCatalogTable: booleanType().optional()
         | 
| 5246 | 
            +
            }).strict();
         | 
| 5247 | 
            +
            var mergedViewWithOption = viewWithOption.merge(matViewWithOption).strict();
         | 
| 5248 | 
            +
            var view2 = objectType({
         | 
| 5249 | 
            +
              name: stringType(),
         | 
| 5250 | 
            +
              schema: stringType(),
         | 
| 5251 | 
            +
              columns: recordType(stringType(), column2),
         | 
| 5252 | 
            +
              definition: stringType().optional(),
         | 
| 5253 | 
            +
              materialized: booleanType(),
         | 
| 5254 | 
            +
              with: mergedViewWithOption.optional(),
         | 
| 5255 | 
            +
              isExisting: booleanType(),
         | 
| 5256 | 
            +
              withNoData: booleanType().optional(),
         | 
| 5257 | 
            +
              using: stringType().optional(),
         | 
| 5258 | 
            +
              tablespace: stringType().optional()
         | 
| 5259 | 
            +
            }).strict();
         | 
| 5192 5260 | 
             
            var tableV42 = objectType({
         | 
| 5193 5261 | 
             
              name: stringType(),
         | 
| 5194 5262 | 
             
              schema: stringType(),
         | 
| @@ -5230,7 +5298,8 @@ var table2 = objectType({ | |
| 5230 5298 | 
             
              indexes: recordType(stringType(), index2),
         | 
| 5231 5299 | 
             
              foreignKeys: recordType(stringType(), fk2),
         | 
| 5232 5300 | 
             
              compositePrimaryKeys: recordType(stringType(), compositePK2),
         | 
| 5233 | 
            -
              uniqueConstraints: recordType(stringType(), uniqueConstraint2).default({})
         | 
| 5301 | 
            +
              uniqueConstraints: recordType(stringType(), uniqueConstraint2).default({}),
         | 
| 5302 | 
            +
              checkConstraints: recordType(stringType(), checkConstraint2).default({})
         | 
| 5234 5303 | 
             
            }).strict();
         | 
| 5235 5304 | 
             
            var schemaHash2 = objectType({
         | 
| 5236 5305 | 
             
              id: stringType(),
         | 
| @@ -5323,6 +5392,7 @@ var pgSchemaInternal = objectType({ | |
| 5323 5392 | 
             
              tables: recordType(stringType(), table2),
         | 
| 5324 5393 | 
             
              enums: recordType(stringType(), enumSchema),
         | 
| 5325 5394 | 
             
              schemas: recordType(stringType(), stringType()),
         | 
| 5395 | 
            +
              views: recordType(stringType(), view2).default({}),
         | 
| 5326 5396 | 
             
              sequences: recordType(stringType(), sequenceSchema).default({}),
         | 
| 5327 5397 | 
             
              _meta: objectType({
         | 
| 5328 5398 | 
             
                schemas: recordType(stringType(), stringType()),
         | 
| @@ -5338,7 +5408,8 @@ var tableSquashed2 = objectType({ | |
| 5338 5408 | 
             
              indexes: recordType(stringType(), stringType()),
         | 
| 5339 5409 | 
             
              foreignKeys: recordType(stringType(), stringType()),
         | 
| 5340 5410 | 
             
              compositePrimaryKeys: recordType(stringType(), stringType()),
         | 
| 5341 | 
            -
              uniqueConstraints: recordType(stringType(), stringType())
         | 
| 5411 | 
            +
              uniqueConstraints: recordType(stringType(), stringType()),
         | 
| 5412 | 
            +
              checkConstraints: recordType(stringType(), stringType())
         | 
| 5342 5413 | 
             
            }).strict();
         | 
| 5343 5414 | 
             
            var tableSquashedV42 = objectType({
         | 
| 5344 5415 | 
             
              name: stringType(),
         | 
| @@ -5367,6 +5438,7 @@ var pgSchemaSquashed = objectType({ | |
| 5367 5438 | 
             
              tables: recordType(stringType(), tableSquashed2),
         | 
| 5368 5439 | 
             
              enums: recordType(stringType(), enumSchema),
         | 
| 5369 5440 | 
             
              schemas: recordType(stringType(), stringType()),
         | 
| 5441 | 
            +
              views: recordType(stringType(), view2),
         | 
| 5370 5442 | 
             
              sequences: recordType(stringType(), sequenceSquashed)
         | 
| 5371 5443 | 
             
            }).strict();
         | 
| 5372 5444 | 
             
            var pgSchemaV3 = pgSchemaInternalV3.merge(schemaHash2);
         | 
| @@ -5438,13 +5510,24 @@ var uniqueConstraint3 = objectType({ | |
| 5438 5510 | 
             
              name: stringType(),
         | 
| 5439 5511 | 
             
              columns: stringType().array()
         | 
| 5440 5512 | 
             
            }).strict();
         | 
| 5513 | 
            +
            var checkConstraint3 = objectType({
         | 
| 5514 | 
            +
              name: stringType(),
         | 
| 5515 | 
            +
              value: stringType()
         | 
| 5516 | 
            +
            }).strict();
         | 
| 5441 5517 | 
             
            var table3 = objectType({
         | 
| 5442 5518 | 
             
              name: stringType(),
         | 
| 5443 5519 | 
             
              columns: recordType(stringType(), column3),
         | 
| 5444 5520 | 
             
              indexes: recordType(stringType(), index3),
         | 
| 5445 5521 | 
             
              foreignKeys: recordType(stringType(), fk3),
         | 
| 5446 5522 | 
             
              compositePrimaryKeys: recordType(stringType(), compositePK3),
         | 
| 5447 | 
            -
              uniqueConstraints: recordType(stringType(), uniqueConstraint3).default({})
         | 
| 5523 | 
            +
              uniqueConstraints: recordType(stringType(), uniqueConstraint3).default({}),
         | 
| 5524 | 
            +
              checkConstraints: recordType(stringType(), checkConstraint3).default({})
         | 
| 5525 | 
            +
            }).strict();
         | 
| 5526 | 
            +
            var view3 = objectType({
         | 
| 5527 | 
            +
              name: stringType(),
         | 
| 5528 | 
            +
              columns: recordType(stringType(), column3),
         | 
| 5529 | 
            +
              definition: stringType().optional(),
         | 
| 5530 | 
            +
              isExisting: booleanType()
         | 
| 5448 5531 | 
             
            }).strict();
         | 
| 5449 5532 | 
             
            var dialect2 = enumType(["sqlite"]);
         | 
| 5450 5533 | 
             
            var schemaHash3 = objectType({
         | 
| @@ -5461,6 +5544,7 @@ var schemaInternalV42 = objectType({ | |
| 5461 5544 | 
             
              version: literalType("4"),
         | 
| 5462 5545 | 
             
              dialect: dialect2,
         | 
| 5463 5546 | 
             
              tables: recordType(stringType(), table3),
         | 
| 5547 | 
            +
              views: recordType(stringType(), view3),
         | 
| 5464 5548 | 
             
              enums: objectType({})
         | 
| 5465 5549 | 
             
            }).strict();
         | 
| 5466 5550 | 
             
            var schemaInternalV52 = objectType({
         | 
| @@ -5489,6 +5573,7 @@ var schemaInternal2 = objectType({ | |
| 5489 5573 | 
             
              version: latestVersion,
         | 
| 5490 5574 | 
             
              dialect: dialect2,
         | 
| 5491 5575 | 
             
              tables: recordType(stringType(), table3),
         | 
| 5576 | 
            +
              views: recordType(stringType(), view3),
         | 
| 5492 5577 | 
             
              enums: objectType({}),
         | 
| 5493 5578 | 
             
              _meta: objectType({
         | 
| 5494 5579 | 
             
                tables: recordType(stringType(), stringType()),
         | 
| @@ -5506,12 +5591,14 @@ var tableSquashed3 = objectType({ | |
| 5506 5591 | 
             
              indexes: recordType(stringType(), stringType()),
         | 
| 5507 5592 | 
             
              foreignKeys: recordType(stringType(), stringType()),
         | 
| 5508 5593 | 
             
              compositePrimaryKeys: recordType(stringType(), stringType()),
         | 
| 5509 | 
            -
              uniqueConstraints: recordType(stringType(), stringType()).default({})
         | 
| 5594 | 
            +
              uniqueConstraints: recordType(stringType(), stringType()).default({}),
         | 
| 5595 | 
            +
              checkConstraints: recordType(stringType(), stringType()).default({})
         | 
| 5510 5596 | 
             
            }).strict();
         | 
| 5511 5597 | 
             
            var schemaSquashed2 = objectType({
         | 
| 5512 5598 | 
             
              version: latestVersion,
         | 
| 5513 5599 | 
             
              dialect: dialect2,
         | 
| 5514 5600 | 
             
              tables: recordType(stringType(), tableSquashed3),
         | 
| 5601 | 
            +
              views: recordType(stringType(), view3),
         | 
| 5515 5602 | 
             
              enums: anyType()
         | 
| 5516 5603 | 
             
            }).strict();
         | 
| 5517 5604 | 
             
            var drySQLite = schema2.parse({
         | 
| @@ -5520,6 +5607,7 @@ var drySQLite = schema2.parse({ | |
| 5520 5607 | 
             
              id: originUUID,
         | 
| 5521 5608 | 
             
              prevId: "",
         | 
| 5522 5609 | 
             
              tables: {},
         | 
| 5610 | 
            +
              views: {},
         | 
| 5523 5611 | 
             
              enums: {},
         | 
| 5524 5612 | 
             
              _meta: {
         | 
| 5525 5613 | 
             
                tables: {},
         | 
| @@ -5739,12 +5827,18 @@ function findAddedAndRemoved(columnNames1, columnNames2) { | |
| 5739 5827 | 
             
              const removedColumns = columnNames1.filter((it) => !set2.has(it));
         | 
| 5740 5828 | 
             
              return { addedColumns, removedColumns };
         | 
| 5741 5829 | 
             
            }
         | 
| 5830 | 
            +
            function getColumnCasing(column4, casing) {
         | 
| 5831 | 
            +
              if (!column4.name)
         | 
| 5832 | 
            +
                return "";
         | 
| 5833 | 
            +
              return !column4.keyAsName || casing === void 0 ? column4.name : casing === "camelCase" ? toCamelCase(column4.name) : toSnakeCase(column4.name);
         | 
| 5834 | 
            +
            }
         | 
| 5742 5835 | 
             
            export {
         | 
| 5743 5836 | 
             
              assertV1OutFolder,
         | 
| 5744 5837 | 
             
              columnRenameKey,
         | 
| 5745 5838 | 
             
              copy,
         | 
| 5746 5839 | 
             
              dryJournal,
         | 
| 5747 5840 | 
             
              findAddedAndRemoved,
         | 
| 5841 | 
            +
              getColumnCasing,
         | 
| 5748 5842 | 
             
              isPgArrayType,
         | 
| 5749 5843 | 
             
              kloudMeta,
         | 
| 5750 5844 | 
             
              normalisePGliteUrl,
         |