@c9up/atlas 0.1.19 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +63 -14
- package/db.darwin-arm64.node +0 -0
- package/db.darwin-x64.node +0 -0
- package/db.linux-arm64-gnu.node +0 -0
- package/db.linux-x64-gnu.node +0 -0
- package/db.win32-x64-msvc.node +0 -0
- package/dist/AtlasProvider.d.ts +66 -7
- package/dist/AtlasProvider.d.ts.map +1 -1
- package/dist/AtlasProvider.js +205 -39
- package/dist/AtlasProvider.js.map +1 -1
- package/dist/BaseEntity.d.ts +181 -5
- package/dist/BaseEntity.d.ts.map +1 -1
- package/dist/BaseEntity.js +339 -33
- package/dist/BaseEntity.js.map +1 -1
- package/dist/BaseModel.d.ts +127 -0
- package/dist/BaseModel.d.ts.map +1 -0
- package/dist/BaseModel.js +250 -0
- package/dist/BaseModel.js.map +1 -0
- package/dist/BaseRepository.d.ts +81 -15
- package/dist/BaseRepository.d.ts.map +1 -1
- package/dist/BaseRepository.js +1433 -387
- package/dist/BaseRepository.js.map +1 -1
- package/dist/ConnectionManager.d.ts +106 -0
- package/dist/ConnectionManager.d.ts.map +1 -0
- package/dist/ConnectionManager.js +228 -0
- package/dist/ConnectionManager.js.map +1 -0
- package/dist/ModelQuery.d.ts +577 -41
- package/dist/ModelQuery.d.ts.map +1 -1
- package/dist/ModelQuery.js +2188 -291
- package/dist/ModelQuery.js.map +1 -1
- package/dist/Transaction.d.ts +71 -1
- package/dist/Transaction.d.ts.map +1 -1
- package/dist/Transaction.js +138 -24
- package/dist/Transaction.js.map +1 -1
- package/dist/adapters/NapiDbAdapter.d.ts +44 -4
- package/dist/adapters/NapiDbAdapter.d.ts.map +1 -1
- package/dist/adapters/NapiDbAdapter.js +131 -13
- package/dist/adapters/NapiDbAdapter.js.map +1 -1
- package/dist/console/contract.d.ts +62 -0
- package/dist/console/contract.d.ts.map +1 -0
- package/dist/console/contract.js +38 -0
- package/dist/console/contract.js.map +1 -0
- package/dist/console/factoryCommands.d.ts +23 -0
- package/dist/console/factoryCommands.d.ts.map +1 -0
- package/dist/console/factoryCommands.js +62 -0
- package/dist/console/factoryCommands.js.map +1 -0
- package/dist/console/migrationCommands.d.ts +78 -0
- package/dist/console/migrationCommands.d.ts.map +1 -0
- package/dist/console/migrationCommands.js +327 -0
- package/dist/console/migrationCommands.js.map +1 -0
- package/dist/console/schemaCheckCommand.d.ts +11 -17
- package/dist/console/schemaCheckCommand.d.ts.map +1 -1
- package/dist/console/schemaCheckCommand.js +21 -15
- package/dist/console/schemaCheckCommand.js.map +1 -1
- package/dist/console/schemaDumpCommand.d.ts +30 -0
- package/dist/console/schemaDumpCommand.d.ts.map +1 -0
- package/dist/console/schemaDumpCommand.js +69 -0
- package/dist/console/schemaDumpCommand.js.map +1 -0
- package/dist/console/schemaGenerateCommand.d.ts +100 -0
- package/dist/console/schemaGenerateCommand.d.ts.map +1 -0
- package/dist/console/schemaGenerateCommand.js +246 -0
- package/dist/console/schemaGenerateCommand.js.map +1 -0
- package/dist/console/seederCommands.d.ts +46 -0
- package/dist/console/seederCommands.d.ts.map +1 -0
- package/dist/console/seederCommands.js +136 -0
- package/dist/console/seederCommands.js.map +1 -0
- package/dist/decorators/entity.d.ts +50 -8
- package/dist/decorators/entity.d.ts.map +1 -1
- package/dist/decorators/entity.js +42 -2
- package/dist/decorators/entity.js.map +1 -1
- package/dist/decorators/hooks.d.ts +3 -3
- package/dist/decorators/hooks.d.ts.map +1 -1
- package/dist/decorators/hooks.js.map +1 -1
- package/dist/events.d.ts +69 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +82 -0
- package/dist/events.js.map +1 -0
- package/dist/factories.d.ts +8 -0
- package/dist/factories.d.ts.map +1 -0
- package/dist/factories.js +8 -0
- package/dist/factories.js.map +1 -0
- package/dist/index.d.ts +15 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -3
- package/dist/index.js.map +1 -1
- package/dist/lucid-schema.d.ts +15 -0
- package/dist/lucid-schema.d.ts.map +1 -0
- package/dist/lucid-schema.js +16 -0
- package/dist/lucid-schema.js.map +1 -0
- package/dist/metadata-keys.d.ts +3 -2
- package/dist/metadata-keys.d.ts.map +1 -1
- package/dist/naming/NamingStrategy.d.ts +7 -0
- package/dist/naming/NamingStrategy.d.ts.map +1 -1
- package/dist/naming/NamingStrategy.js +16 -0
- package/dist/naming/NamingStrategy.js.map +1 -1
- package/dist/orm.d.ts +14 -0
- package/dist/orm.d.ts.map +1 -0
- package/dist/orm.js +14 -0
- package/dist/orm.js.map +1 -0
- package/dist/query/DatabaseQueryBuilder.d.ts +557 -0
- package/dist/query/DatabaseQueryBuilder.d.ts.map +1 -0
- package/dist/query/DatabaseQueryBuilder.js +1798 -0
- package/dist/query/DatabaseQueryBuilder.js.map +1 -0
- package/dist/query/DmlBuilder.d.ts +62 -0
- package/dist/query/DmlBuilder.d.ts.map +1 -0
- package/dist/query/DmlBuilder.js +84 -0
- package/dist/query/DmlBuilder.js.map +1 -0
- package/dist/query/QueryBuilder.d.ts +5 -0
- package/dist/query/QueryBuilder.d.ts.map +1 -1
- package/dist/query/QueryBuilder.js +7 -0
- package/dist/query/QueryBuilder.js.map +1 -1
- package/dist/query/RawQueryBuilder.d.ts +47 -0
- package/dist/query/RawQueryBuilder.d.ts.map +1 -0
- package/dist/query/RawQueryBuilder.js +138 -0
- package/dist/query/RawQueryBuilder.js.map +1 -0
- package/dist/query/interpolate.d.ts +45 -0
- package/dist/query/interpolate.d.ts.map +1 -0
- package/dist/query/interpolate.js +51 -0
- package/dist/query/interpolate.js.map +1 -0
- package/dist/query/native.d.ts +8 -0
- package/dist/query/native.d.ts.map +1 -1
- package/dist/query/native.js +14 -0
- package/dist/query/native.js.map +1 -1
- package/dist/query/operators.d.ts +4 -0
- package/dist/query/operators.d.ts.map +1 -0
- package/dist/query/operators.js +27 -0
- package/dist/query/operators.js.map +1 -0
- package/dist/schema/Migration.d.ts +50 -3
- package/dist/schema/Migration.d.ts.map +1 -1
- package/dist/schema/Migration.js +60 -24
- package/dist/schema/Migration.js.map +1 -1
- package/dist/schema/MigrationRunner.d.ts +95 -34
- package/dist/schema/MigrationRunner.d.ts.map +1 -1
- package/dist/schema/MigrationRunner.js +523 -68
- package/dist/schema/MigrationRunner.js.map +1 -1
- package/dist/schema/Schema.d.ts +114 -0
- package/dist/schema/Schema.d.ts.map +1 -1
- package/dist/schema/Schema.js +272 -3
- package/dist/schema/Schema.js.map +1 -1
- package/dist/schema/SchemaDumper.d.ts +121 -0
- package/dist/schema/SchemaDumper.d.ts.map +1 -0
- package/dist/schema/SchemaDumper.js +365 -0
- package/dist/schema/SchemaDumper.js.map +1 -0
- package/dist/schema/Seeder.d.ts +13 -0
- package/dist/schema/Seeder.d.ts.map +1 -1
- package/dist/schema/Seeder.js +28 -5
- package/dist/schema/Seeder.js.map +1 -1
- package/dist/schema/TableBuilder.d.ts +274 -16
- package/dist/schema/TableBuilder.d.ts.map +1 -1
- package/dist/schema/TableBuilder.js +656 -52
- package/dist/schema/TableBuilder.js.map +1 -1
- package/dist/schema/catalog.d.ts +71 -0
- package/dist/schema/catalog.d.ts.map +1 -0
- package/dist/schema/catalog.js +158 -0
- package/dist/schema/catalog.js.map +1 -0
- package/dist/schema/introspect.d.ts +1 -1
- package/dist/schema/introspect.d.ts.map +1 -1
- package/dist/schema/introspect.js +26 -11
- package/dist/schema/introspect.js.map +1 -1
- package/dist/schema/types.d.ts +150 -1
- package/dist/schema/types.d.ts.map +1 -1
- package/dist/schema/types.js +11 -0
- package/dist/schema/types.js.map +1 -1
- package/dist/seeders.d.ts +7 -0
- package/dist/seeders.d.ts.map +1 -0
- package/dist/seeders.js +7 -0
- package/dist/seeders.js.map +1 -0
- package/dist/services/db.d.ts +122 -5
- package/dist/services/db.d.ts.map +1 -1
- package/dist/services/db.js +187 -14
- package/dist/services/db.js.map +1 -1
- package/dist/testing/DatabaseCleanup.d.ts +33 -7
- package/dist/testing/DatabaseCleanup.d.ts.map +1 -1
- package/dist/testing/DatabaseCleanup.js +54 -24
- package/dist/testing/DatabaseCleanup.js.map +1 -1
- package/dist/testing/DbAssertions.d.ts +48 -0
- package/dist/testing/DbAssertions.d.ts.map +1 -0
- package/dist/testing/DbAssertions.js +80 -0
- package/dist/testing/DbAssertions.js.map +1 -0
- package/dist/testing/Factory.d.ts +166 -15
- package/dist/testing/Factory.d.ts.map +1 -1
- package/dist/testing/Factory.js +497 -23
- package/dist/testing/Factory.js.map +1 -1
- package/dist/testing/TestUtils.d.ts +49 -0
- package/dist/testing/TestUtils.d.ts.map +1 -0
- package/dist/testing/TestUtils.js +79 -0
- package/dist/testing/TestUtils.js.map +1 -0
- package/dist/testing/index.d.ts +3 -1
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +3 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/types/relations.d.ts +31 -0
- package/dist/types/relations.d.ts.map +1 -0
- package/dist/types/relations.js +20 -0
- package/dist/types/relations.js.map +1 -0
- package/index.darwin-arm64.node +0 -0
- package/index.darwin-x64.node +0 -0
- package/index.linux-arm64-gnu.node +0 -0
- package/index.linux-x64-gnu.node +0 -0
- package/index.win32-x64-msvc.node +0 -0
- package/package.json +32 -2
- package/scripts/guard-publish.mjs +15 -0
- package/src/AtlasProvider.ts +305 -52
- package/src/BaseEntity.ts +460 -41
- package/src/BaseModel.ts +461 -0
- package/src/BaseRepository.ts +1710 -421
- package/src/ConnectionManager.ts +298 -0
- package/src/ModelQuery.ts +2998 -335
- package/src/Transaction.ts +227 -30
- package/src/adapters/NapiDbAdapter.ts +224 -17
- package/src/console/contract.ts +96 -0
- package/src/console/factoryCommands.ts +73 -0
- package/src/console/migrationCommands.ts +448 -0
- package/src/console/schemaCheckCommand.ts +26 -22
- package/src/console/schemaDumpCommand.ts +96 -0
- package/src/console/schemaGenerateCommand.ts +380 -0
- package/src/console/seederCommands.ts +174 -0
- package/src/decorators/entity.ts +71 -8
- package/src/decorators/hooks.ts +5 -3
- package/src/events.ts +117 -0
- package/src/factories.ts +10 -0
- package/src/index.ts +69 -3
- package/src/lucid-schema.ts +22 -0
- package/src/metadata-keys.ts +3 -2
- package/src/naming/NamingStrategy.ts +23 -0
- package/src/orm.ts +13 -0
- package/src/query/DatabaseQueryBuilder.ts +2724 -0
- package/src/query/DmlBuilder.ts +131 -0
- package/src/query/QueryBuilder.ts +8 -0
- package/src/query/RawQueryBuilder.ts +173 -0
- package/src/query/interpolate.ts +73 -0
- package/src/query/native.ts +29 -0
- package/src/query/operators.ts +27 -0
- package/src/schema/Migration.ts +71 -3
- package/src/schema/MigrationRunner.ts +676 -69
- package/src/schema/Schema.ts +359 -3
- package/src/schema/SchemaDumper.ts +518 -0
- package/src/schema/Seeder.ts +47 -10
- package/src/schema/TableBuilder.ts +783 -52
- package/src/schema/catalog.ts +236 -0
- package/src/schema/introspect.ts +26 -9
- package/src/schema/types.ts +137 -2
- package/src/seeders.ts +16 -0
- package/src/services/db.ts +361 -21
- package/src/testing/DatabaseCleanup.ts +78 -25
- package/src/testing/DbAssertions.ts +127 -0
- package/src/testing/Factory.ts +837 -40
- package/src/testing/TestUtils.ts +123 -0
- package/src/testing/index.ts +12 -1
- package/src/types/relations.ts +43 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interpolate.d.ts","sourceRoot":"","sources":["../../src/query/interpolate.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,qFAAqF;AACrF,wBAAgB,aAAa,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,CAOhD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC/B,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,SAAS,OAAO,EAAE,GACxB,MAAM,CAKR;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,MAAM,EAAE,OAAO,EAAE,CAAC;IAClB,uEAAuE;IACvE,QAAQ,IAAI;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,EAAE,CAAA;KAAE,CAAC;CACjD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAChC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,OAAO,EAAE,GACf,iBAAiB,CAOnB"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Query-inspection helpers shared by every builder's `toQuery()` / `toSQL()`.
|
|
3
|
+
*
|
|
4
|
+
* `toQuery()` returns the SQL with bindings substituted as literals (Adonis
|
|
5
|
+
* Lucid semantics — `where "is_active" = 1`), for ad-hoc inspection ONLY. It is
|
|
6
|
+
* NOT injection-safe; forward `toSQL()` + bindings to logs instead.
|
|
7
|
+
*/
|
|
8
|
+
/** SQL-literal render of a single binding (inspection only — not injection-safe). */
|
|
9
|
+
export function literalEscape(v) {
|
|
10
|
+
if (v === null || v === undefined)
|
|
11
|
+
return "NULL";
|
|
12
|
+
if (typeof v === "number")
|
|
13
|
+
return String(v);
|
|
14
|
+
if (typeof v === "boolean")
|
|
15
|
+
return v ? "1" : "0";
|
|
16
|
+
if (v instanceof Date)
|
|
17
|
+
return `'${v.toISOString()}'`;
|
|
18
|
+
// Strings — escape single quotes per SQL. NOT hardened against `\'`.
|
|
19
|
+
return `'${String(v).replace(/'/g, "''")}'`;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Substitute native placeholders (`?` sequentially, `$N` by 1-based index) with
|
|
23
|
+
* dialect-safe literals — Lucid `toQuery`. `$N` is resolved by its own index so
|
|
24
|
+
* a reused/reordered Postgres placeholder still maps to the right binding.
|
|
25
|
+
*/
|
|
26
|
+
export function interpolateQuery(sql, params) {
|
|
27
|
+
let seq = 0;
|
|
28
|
+
return sql.replace(/\?|\$\d+/g, (tok) => literalEscape(params[tok[0] === "$" ? Number(tok.slice(1)) - 1 : seq++]));
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Normalize dialect-native positional placeholders (`$1`, `$2`, … — Postgres) to
|
|
32
|
+
* Knex-style `?`, matching what Lucid's `toSQL().sql` returns for every dialect.
|
|
33
|
+
* MySQL/SQLite already emit `?`, so this is a no-op there. Display concern only:
|
|
34
|
+
* atlas executes with the native statement (see `toNative`).
|
|
35
|
+
*/
|
|
36
|
+
export function toQuestionMarks(sql) {
|
|
37
|
+
return sql.replace(/\$\d+/g, "?");
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Wrap a NATIVE compiled `sql` + `params` as a Lucid-shaped {@link CompiledStatement}:
|
|
41
|
+
* the public `.sql` is `?`-normalized, `.toNative()` yields the native form.
|
|
42
|
+
*/
|
|
43
|
+
export function compiledStatement(nativeSql, params) {
|
|
44
|
+
return {
|
|
45
|
+
sql: toQuestionMarks(nativeSql),
|
|
46
|
+
bindings: params,
|
|
47
|
+
params,
|
|
48
|
+
toNative: () => ({ sql: nativeSql, bindings: params }),
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=interpolate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interpolate.js","sourceRoot":"","sources":["../../src/query/interpolate.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,qFAAqF;AACrF,MAAM,UAAU,aAAa,CAAC,CAAU;IACvC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC;IACjD,IAAI,OAAO,CAAC,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;IAC5C,IAAI,OAAO,CAAC,KAAK,SAAS;QAAE,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;IACjD,IAAI,CAAC,YAAY,IAAI;QAAE,OAAO,IAAI,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC;IACrD,qEAAqE;IACrE,OAAO,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC;AAC7C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAC/B,GAAW,EACX,MAA0B;IAE1B,IAAI,GAAG,GAAG,CAAC,CAAC;IACZ,OAAO,GAAG,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,GAAG,EAAE,EAAE,CACvC,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CACxE,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,GAAW;IAC1C,OAAO,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;AACnC,CAAC;AAiBD;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAChC,SAAiB,EACjB,MAAiB;IAEjB,OAAO;QACN,GAAG,EAAE,eAAe,CAAC,SAAS,CAAC;QAC/B,QAAQ,EAAE,MAAM;QAChB,MAAM;QACN,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;KACtD,CAAC;AACH,CAAC"}
|
package/dist/query/native.d.ts
CHANGED
|
@@ -4,6 +4,14 @@
|
|
|
4
4
|
* @implements FR36
|
|
5
5
|
*/
|
|
6
6
|
export type AtlasDialect = "sqlite" | "postgres" | "mysql";
|
|
7
|
+
/**
|
|
8
|
+
* Dialect names accepted by `ifDialect`/`unlessDialect`, including the Lucid/Knex
|
|
9
|
+
* client aliases — so a callback ported from Lucid (`ifDialect('sqlite3', …)`,
|
|
10
|
+
* which Lucid names `sqlite3`/`better-sqlite3`, not `sqlite`) still matches.
|
|
11
|
+
*/
|
|
12
|
+
export type DialectName = AtlasDialect | "sqlite3" | "better-sqlite3" | "postgresql" | "pg" | "mysql2";
|
|
13
|
+
/** Map a Lucid/Knex dialect name to the atlas dialect, or `undefined` if unknown. */
|
|
14
|
+
export declare function normalizeDialect(name: string): AtlasDialect | undefined;
|
|
7
15
|
export declare function setAtlasDialect(dialect: AtlasDialect): void;
|
|
8
16
|
export declare function getAtlasDialect(): AtlasDialect;
|
|
9
17
|
export interface CompiledStatement {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../../src/query/native.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAoCH,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../../src/query/native.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAoCH,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAC;AAE3D;;;;GAIG;AACH,MAAM,MAAM,WAAW,GACpB,YAAY,GACZ,SAAS,GACT,gBAAgB,GAChB,YAAY,GACZ,IAAI,GACJ,QAAQ,CAAC;AAaZ,qFAAqF;AACrF,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAEvE;AAKD,wBAAgB,eAAe,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI,CAE3D;AAED,wBAAgB,eAAe,IAAI,YAAY,CAE9C;AAED,MAAM,WAAW,iBAAiB;IACjC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,OAAO,EAAE,CAAC;CAClB;AAaD;;;;;GAKG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAExC;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CACjC,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC3B,IAAI,CAIN;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CACjC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,GACV,IAAI,CAIN;AAuCD;;;GAGG;AACH,wBAAgB,sBAAsB,CACrC,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,YAA6B,GACpC,iBAAiB,CAYnB"}
|
package/dist/query/native.js
CHANGED
|
@@ -27,6 +27,20 @@ try {
|
|
|
27
27
|
catch (e) {
|
|
28
28
|
loadError = e;
|
|
29
29
|
}
|
|
30
|
+
const DIALECT_ALIASES = {
|
|
31
|
+
sqlite: "sqlite",
|
|
32
|
+
sqlite3: "sqlite",
|
|
33
|
+
"better-sqlite3": "sqlite",
|
|
34
|
+
postgres: "postgres",
|
|
35
|
+
postgresql: "postgres",
|
|
36
|
+
pg: "postgres",
|
|
37
|
+
mysql: "mysql",
|
|
38
|
+
mysql2: "mysql",
|
|
39
|
+
};
|
|
40
|
+
/** Map a Lucid/Knex dialect name to the atlas dialect, or `undefined` if unknown. */
|
|
41
|
+
export function normalizeDialect(name) {
|
|
42
|
+
return DIALECT_ALIASES[name];
|
|
43
|
+
}
|
|
30
44
|
/** Module-level default dialect. Set by AtlasProvider at boot. */
|
|
31
45
|
let defaultDialect = "sqlite";
|
|
32
46
|
export function setAtlasDialect(dialect) {
|
package/dist/query/native.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.js","sourceRoot":"","sources":["../../src/query/native.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,cAAc,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G,MAAM,CAIjD"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** SQL operator helpers shared by the query builders. */
|
|
2
|
+
const NEGATION = {
|
|
3
|
+
"=": "!=",
|
|
4
|
+
"!=": "=",
|
|
5
|
+
"<>": "=",
|
|
6
|
+
"<": ">=",
|
|
7
|
+
">": "<=",
|
|
8
|
+
"<=": ">",
|
|
9
|
+
">=": "<",
|
|
10
|
+
IN: "NOT IN",
|
|
11
|
+
"NOT IN": "IN",
|
|
12
|
+
LIKE: "NOT LIKE",
|
|
13
|
+
"NOT LIKE": "LIKE",
|
|
14
|
+
ILIKE: "NOT ILIKE",
|
|
15
|
+
BETWEEN: "NOT BETWEEN",
|
|
16
|
+
"NOT BETWEEN": "BETWEEN",
|
|
17
|
+
"IS NULL": "IS NOT NULL",
|
|
18
|
+
"IS NOT NULL": "IS NULL",
|
|
19
|
+
};
|
|
20
|
+
/** The logical negation of a comparison operator (`>=` → `<`, `=` → `!=`, …). */
|
|
21
|
+
export function negateOperator(op) {
|
|
22
|
+
const negated = NEGATION[op.toUpperCase()] ?? NEGATION[op];
|
|
23
|
+
if (!negated)
|
|
24
|
+
throw new Error(`whereNot: unsupported operator '${op}'`);
|
|
25
|
+
return negated;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=operators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operators.js","sourceRoot":"","sources":["../../src/query/operators.ts"],"names":[],"mappings":"AAAA,yDAAyD;AAEzD,MAAM,QAAQ,GAA2B;IACxC,GAAG,EAAE,IAAI;IACT,IAAI,EAAE,GAAG;IACT,IAAI,EAAE,GAAG;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,IAAI,EAAE,GAAG;IACT,IAAI,EAAE,GAAG;IACT,EAAE,EAAE,QAAQ;IACZ,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE,UAAU;IAChB,UAAU,EAAE,MAAM;IAClB,KAAK,EAAE,WAAW;IAClB,OAAO,EAAE,aAAa;IACtB,aAAa,EAAE,SAAS;IACxB,SAAS,EAAE,aAAa;IACxB,aAAa,EAAE,SAAS;CACxB,CAAC;AAEF,iFAAiF;AACjF,MAAM,UAAU,cAAc,CAAC,EAAU;IACxC,MAAM,OAAO,GAAG,QAAQ,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,IAAI,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC3D,IAAI,CAAC,OAAO;QAAE,MAAM,IAAI,KAAK,CAAC,mCAAmC,EAAE,GAAG,CAAC,CAAC;IACxE,OAAO,OAAO,CAAC;AAChB,CAAC"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { AtlasDialect } from "../query/native.js";
|
|
7
7
|
import { RawSql } from "../query/QueryBuilder.js";
|
|
8
|
+
import type { CatalogConnection } from "./catalog.js";
|
|
8
9
|
import { Schema } from "./SchemaBuilder.js";
|
|
9
10
|
/**
|
|
10
11
|
* Base class for all migrations.
|
|
@@ -27,10 +28,52 @@ import { Schema } from "./SchemaBuilder.js";
|
|
|
27
28
|
* }
|
|
28
29
|
* }
|
|
29
30
|
*/
|
|
31
|
+
/**
|
|
32
|
+
* A deferred operation registered with `this.defer()`. Runs after the
|
|
33
|
+
* migration's schema statements, with a live connection handle (execute/query).
|
|
34
|
+
*/
|
|
35
|
+
export type DeferredMigrationCallback = (db: CatalogConnection) => Promise<void> | void;
|
|
30
36
|
export declare abstract class Migration {
|
|
31
37
|
#private;
|
|
38
|
+
/**
|
|
39
|
+
* Adonis Lucid `static disableTransactions`. Set `static disableTransactions =
|
|
40
|
+
* true` on a migration to run it OUTSIDE a transaction — for DDL that cannot
|
|
41
|
+
* run inside one (e.g. Postgres `CREATE INDEX CONCURRENTLY`). Applies to both
|
|
42
|
+
* `up()` and `down()`; the runner then executes the migration non-atomically
|
|
43
|
+
* by design (so `this.defer()` runs loose too). Defaults to `false`.
|
|
44
|
+
*/
|
|
45
|
+
static disableTransactions: boolean;
|
|
32
46
|
readonly schema: Schema;
|
|
47
|
+
/**
|
|
48
|
+
* Adonis Lucid `this.dryRun` — `true` while the runner generates SQL without
|
|
49
|
+
* executing it (set by `MigrationRunner.dryRun()`). Read it in `up()`/`down()`
|
|
50
|
+
* to conditionally skip side-effectful branches. Defaults to `false`.
|
|
51
|
+
*/
|
|
52
|
+
dryRun: boolean;
|
|
33
53
|
constructor(dialect?: AtlasDialect);
|
|
54
|
+
/**
|
|
55
|
+
* Register a callback to run AFTER this migration's schema statements (Adonis
|
|
56
|
+
* Lucid `this.defer`) — typically to seed/backfill data into a table the same
|
|
57
|
+
* migration just created. The callback gets a live connection handle and runs
|
|
58
|
+
* in registration order, interleaved with the schema.
|
|
59
|
+
*
|
|
60
|
+
* ATOMICITY (Lucid parity): by default the schema, the deferred callbacks AND
|
|
61
|
+
* the migration's tracking row all run in ONE transaction — a throwing callback
|
|
62
|
+
* rolls the schema back too, so the migration is all-or-nothing and re-runnable
|
|
63
|
+
* (fully atomic on sqlite/postgres; MySQL auto-commits DDL, so only its tracking
|
|
64
|
+
* row is bound to the callbacks). The one exception is a migration with `static
|
|
65
|
+
* disableTransactions = true`: it opts out of the transaction entirely (for
|
|
66
|
+
* txn-incompatible DDL), so there the deferred work runs non-atomically, by
|
|
67
|
+
* design.
|
|
68
|
+
*/
|
|
69
|
+
defer(callback: DeferredMigrationCallback): void;
|
|
70
|
+
/**
|
|
71
|
+
* @internal Effective `static disableTransactions` of the concrete subclass —
|
|
72
|
+
* read by the runner to decide whether to wrap this migration in a transaction.
|
|
73
|
+
*/
|
|
74
|
+
get transactionsDisabled(): boolean;
|
|
75
|
+
/** @internal Return and clear the deferred callbacks — called by the runner. */
|
|
76
|
+
consumeDeferred(): DeferredMigrationCallback[];
|
|
34
77
|
/** Apply the migration. */
|
|
35
78
|
abstract up(): Promise<void> | void;
|
|
36
79
|
/** Rollback the migration. */
|
|
@@ -49,8 +92,12 @@ export declare abstract class Migration {
|
|
|
49
92
|
* default would blow up at DDL compile time.
|
|
50
93
|
*/
|
|
51
94
|
now(): RawSql;
|
|
52
|
-
/**
|
|
53
|
-
|
|
54
|
-
|
|
95
|
+
/**
|
|
96
|
+
* Get the SQL statements generated by this migration. A `connection` (passed
|
|
97
|
+
* by the runner) is bound to the schema so `this.schema.hasTable()` /
|
|
98
|
+
* `hasColumn()` can query the live catalog from inside `up`/`down`.
|
|
99
|
+
*/
|
|
100
|
+
getUpSQL(connection?: CatalogConnection): Promise<string[]>;
|
|
101
|
+
getDownSQL(connection?: CatalogConnection): Promise<string[]>;
|
|
55
102
|
}
|
|
56
103
|
//# sourceMappingURL=Migration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Migration.d.ts","sourceRoot":"","sources":["../../src/schema/Migration.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,8BAAsB,SAAS;;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"Migration.d.ts","sourceRoot":"","sources":["../../src/schema/Migration.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG,CACvC,EAAE,EAAE,iBAAiB,KACjB,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AAE1B,8BAAsB,SAAS;;IAC9B;;;;;;OAMG;IACH,MAAM,CAAC,mBAAmB,UAAS;IAEnC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,MAAM,UAAS;gBAIH,OAAO,CAAC,EAAE,YAAY;IAQlC;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,QAAQ,EAAE,yBAAyB,GAAG,IAAI;IAIhD;;;OAGG;IACH,IAAI,oBAAoB,IAAI,OAAO,CAGlC;IAED,gFAAgF;IAChF,eAAe,IAAI,yBAAyB,EAAE;IAM9C,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAEnC,8BAA8B;IAC9B,QAAQ,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAErC,sFAAsF;IACtF,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;IAI/B;;;;;;;;;;OAUG;IACH,GAAG,IAAI,MAAM;IAMb;;;;OAIG;IACG,QAAQ,CAAC,UAAU,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAQ3D,UAAU,CAAC,UAAU,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;CAOnE"}
|
package/dist/schema/Migration.js
CHANGED
|
@@ -5,30 +5,24 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { RawSql } from "../query/QueryBuilder.js";
|
|
7
7
|
import { Schema } from "./SchemaBuilder.js";
|
|
8
|
-
/**
|
|
9
|
-
* Base class for all migrations.
|
|
10
|
-
*
|
|
11
|
-
* Usage:
|
|
12
|
-
* import { Migration } from '@c9up/atlas'
|
|
13
|
-
*
|
|
14
|
-
* export default class CreateOrders extends Migration {
|
|
15
|
-
* async up() {
|
|
16
|
-
* this.schema.createTable('orders', (table) => {
|
|
17
|
-
* table.id()
|
|
18
|
-
* table.string('status', 50).notNullable().defaultTo("'pending'")
|
|
19
|
-
* table.decimal('total', 10, 2).notNullable()
|
|
20
|
-
* table.timestamps()
|
|
21
|
-
* })
|
|
22
|
-
* }
|
|
23
|
-
*
|
|
24
|
-
* async down() {
|
|
25
|
-
* this.schema.dropTable('orders')
|
|
26
|
-
* }
|
|
27
|
-
* }
|
|
28
|
-
*/
|
|
29
8
|
export class Migration {
|
|
9
|
+
/**
|
|
10
|
+
* Adonis Lucid `static disableTransactions`. Set `static disableTransactions =
|
|
11
|
+
* true` on a migration to run it OUTSIDE a transaction — for DDL that cannot
|
|
12
|
+
* run inside one (e.g. Postgres `CREATE INDEX CONCURRENTLY`). Applies to both
|
|
13
|
+
* `up()` and `down()`; the runner then executes the migration non-atomically
|
|
14
|
+
* by design (so `this.defer()` runs loose too). Defaults to `false`.
|
|
15
|
+
*/
|
|
16
|
+
static disableTransactions = false;
|
|
30
17
|
schema;
|
|
18
|
+
/**
|
|
19
|
+
* Adonis Lucid `this.dryRun` — `true` while the runner generates SQL without
|
|
20
|
+
* executing it (set by `MigrationRunner.dryRun()`). Read it in `up()`/`down()`
|
|
21
|
+
* to conditionally skip side-effectful branches. Defaults to `false`.
|
|
22
|
+
*/
|
|
23
|
+
dryRun = false;
|
|
31
24
|
#dialect;
|
|
25
|
+
#deferred = [];
|
|
32
26
|
constructor(dialect) {
|
|
33
27
|
this.schema = new Schema(dialect);
|
|
34
28
|
// Default to sqlite when no dialect is passed — the generator emits
|
|
@@ -36,6 +30,38 @@ export class Migration {
|
|
|
36
30
|
// on postgres/mysql too, so this is the safest conservative default.
|
|
37
31
|
this.#dialect = dialect ?? "sqlite";
|
|
38
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Register a callback to run AFTER this migration's schema statements (Adonis
|
|
35
|
+
* Lucid `this.defer`) — typically to seed/backfill data into a table the same
|
|
36
|
+
* migration just created. The callback gets a live connection handle and runs
|
|
37
|
+
* in registration order, interleaved with the schema.
|
|
38
|
+
*
|
|
39
|
+
* ATOMICITY (Lucid parity): by default the schema, the deferred callbacks AND
|
|
40
|
+
* the migration's tracking row all run in ONE transaction — a throwing callback
|
|
41
|
+
* rolls the schema back too, so the migration is all-or-nothing and re-runnable
|
|
42
|
+
* (fully atomic on sqlite/postgres; MySQL auto-commits DDL, so only its tracking
|
|
43
|
+
* row is bound to the callbacks). The one exception is a migration with `static
|
|
44
|
+
* disableTransactions = true`: it opts out of the transaction entirely (for
|
|
45
|
+
* txn-incompatible DDL), so there the deferred work runs non-atomically, by
|
|
46
|
+
* design.
|
|
47
|
+
*/
|
|
48
|
+
defer(callback) {
|
|
49
|
+
this.#deferred.push(callback);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* @internal Effective `static disableTransactions` of the concrete subclass —
|
|
53
|
+
* read by the runner to decide whether to wrap this migration in a transaction.
|
|
54
|
+
*/
|
|
55
|
+
get transactionsDisabled() {
|
|
56
|
+
const ctor = this.constructor;
|
|
57
|
+
return "disableTransactions" in ctor && ctor.disableTransactions === true;
|
|
58
|
+
}
|
|
59
|
+
/** @internal Return and clear the deferred callbacks — called by the runner. */
|
|
60
|
+
consumeDeferred() {
|
|
61
|
+
const deferred = this.#deferred;
|
|
62
|
+
this.#deferred = [];
|
|
63
|
+
return deferred;
|
|
64
|
+
}
|
|
39
65
|
/** Helper: raw SQL expression for a column DEFAULT — emitted verbatim, not quoted. */
|
|
40
66
|
raw(expression) {
|
|
41
67
|
return new RawSql(expression);
|
|
@@ -54,14 +80,24 @@ export class Migration {
|
|
|
54
80
|
now() {
|
|
55
81
|
return new RawSql(this.#dialect === "sqlite" ? "CURRENT_TIMESTAMP" : "NOW()");
|
|
56
82
|
}
|
|
57
|
-
/**
|
|
58
|
-
|
|
83
|
+
/**
|
|
84
|
+
* Get the SQL statements generated by this migration. A `connection` (passed
|
|
85
|
+
* by the runner) is bound to the schema so `this.schema.hasTable()` /
|
|
86
|
+
* `hasColumn()` can query the live catalog from inside `up`/`down`.
|
|
87
|
+
*/
|
|
88
|
+
async getUpSQL(connection) {
|
|
89
|
+
if (connection)
|
|
90
|
+
this.schema.bindConnection(connection);
|
|
59
91
|
this.schema.reset();
|
|
92
|
+
this.#deferred = [];
|
|
60
93
|
await this.up();
|
|
61
94
|
return this.schema.toSQL();
|
|
62
95
|
}
|
|
63
|
-
async getDownSQL() {
|
|
96
|
+
async getDownSQL(connection) {
|
|
97
|
+
if (connection)
|
|
98
|
+
this.schema.bindConnection(connection);
|
|
64
99
|
this.schema.reset();
|
|
100
|
+
this.#deferred = [];
|
|
65
101
|
await this.down();
|
|
66
102
|
return this.schema.toSQL();
|
|
67
103
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Migration.js","sourceRoot":"","sources":["../../src/schema/Migration.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"Migration.js","sourceRoot":"","sources":["../../src/schema/Migration.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AA+B5C,MAAM,OAAgB,SAAS;IAC9B;;;;;;OAMG;IACH,MAAM,CAAC,mBAAmB,GAAG,KAAK,CAAC;IAE1B,MAAM,CAAS;IACxB;;;;OAIG;IACH,MAAM,GAAG,KAAK,CAAC;IACN,QAAQ,CAAe;IAChC,SAAS,GAAgC,EAAE,CAAC;IAE5C,YAAY,OAAsB;QACjC,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC;QAClC,oEAAoE;QACpE,uEAAuE;QACvE,qEAAqE;QACrE,IAAI,CAAC,QAAQ,GAAG,OAAO,IAAI,QAAQ,CAAC;IACrC,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,QAAmC;QACxC,IAAI,C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C;QAClB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IAC5B,CAAC"}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* @implements FR34
|
|
5
5
|
*/
|
|
6
6
|
import { type AtlasDialect } from "../query/native.js";
|
|
7
|
+
import { type CatalogConnection } from "./catalog.js";
|
|
7
8
|
export interface BatchStmt {
|
|
8
9
|
sql: string;
|
|
9
10
|
params?: unknown[];
|
|
@@ -19,6 +20,17 @@ export interface DatabaseAdapter {
|
|
|
19
20
|
* "Migrations non transactionnelles" in the remediation audit).
|
|
20
21
|
*/
|
|
21
22
|
runInTransaction?(batch: readonly BatchStmt[]): Promise<number>;
|
|
23
|
+
/**
|
|
24
|
+
* Optional MANAGED interactive transaction pinned to one connection (Lucid
|
|
25
|
+
* `db.transaction(cb)`): commit on success, rollback on throw. Real
|
|
26
|
+
* connections (`createNapiConnection`), the provider and the CLI all supply
|
|
27
|
+
* it. It is REQUIRED for the two operations whose strong guarantee cannot be
|
|
28
|
+
* faked without it: `this.defer()` (its callbacks must share the migration's
|
|
29
|
+
* transaction) and MySQL FK suspension (a session-level `SET` needs a real
|
|
30
|
+
* `finally` to restore). Both REJECT rather than silently degrade when it is
|
|
31
|
+
* absent — plain migrations without either feature don't need it.
|
|
32
|
+
*/
|
|
33
|
+
transaction?<T>(callback: (trx: CatalogConnection) => Promise<T>): Promise<T>;
|
|
22
34
|
/** Close the connection. */
|
|
23
35
|
close(): Promise<void>;
|
|
24
36
|
}
|
|
@@ -38,70 +50,119 @@ export interface MigrationStatus {
|
|
|
38
50
|
*/
|
|
39
51
|
export declare class MigrationRunner {
|
|
40
52
|
#private;
|
|
41
|
-
/**
|
|
42
|
-
* @param db Underlying database adapter.
|
|
43
|
-
* @param options.migrationsDir Directory containing migration files. Defaults to `database/migrations`.
|
|
44
|
-
* @param options.dialect SQL dialect of the adapter. Defaults to `sqlite`.
|
|
45
|
-
* @param options.tableName Custom name for the migrations tracking table.
|
|
46
|
-
* Defaults to `"ream_migrations"`. Must match `/^[A-Za-z_][A-Za-z0-9_]*$/` —
|
|
47
|
-
* throws `AtlasError("MIGRATION_INVALID_TABLE_NAME")` synchronously otherwise.
|
|
48
|
-
*
|
|
49
|
-
* Cleanup coupling: `DatabaseCleanup.truncateAll` (`src/testing/DatabaseCleanup.ts`)
|
|
50
|
-
* skips tables whose name starts with `ream_` (via `LIKE 'ream\_%' ESCAPE '\'`).
|
|
51
|
-
* The default `"ream_migrations"` is therefore auto-protected. Choosing a name
|
|
52
|
-
* without the `ream_` prefix (e.g. `"schema_versions"`) opts the tracking table
|
|
53
|
-
* out of that protection — `truncateAll` will wipe it alongside user tables,
|
|
54
|
-
* forcing a re-`init()` and replay of every migration on next test run.
|
|
55
|
-
*
|
|
56
|
-
* Rename caveat: `init()` emits `CREATE TABLE IF NOT EXISTS <tableName>` —
|
|
57
|
-
* it does NOT auto-migrate from a previous tracking table. A project that
|
|
58
|
-
* has been running with `ream_migrations` and then changes `tableName` to
|
|
59
|
-
* `schema_versions` will get a fresh empty `schema_versions` on next boot,
|
|
60
|
-
* read zero applied migrations, and re-run every past migration (likely
|
|
61
|
-
* crashing on `CREATE TABLE <user-table>` already-exists). To rename
|
|
62
|
-
* safely, copy the history manually before switching:
|
|
63
|
-
*
|
|
64
|
-
* INSERT INTO schema_versions SELECT * FROM ream_migrations;
|
|
65
|
-
* -- (then DROP TABLE ream_migrations once verified)
|
|
66
|
-
*/
|
|
67
53
|
constructor(db: DatabaseAdapter, options?: {
|
|
68
54
|
migrationsDir?: string;
|
|
69
55
|
dialect?: AtlasDialect;
|
|
70
56
|
tableName?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Refuse destructive ops (rollback/reset/refresh/fresh/wipe) when
|
|
59
|
+
* `NODE_ENV === 'production'` (Adonis Lucid `disableRollbacksInProduction`)
|
|
60
|
+
* — a guard against dropping production data by accident. **Defaults to
|
|
61
|
+
* ON**, matching Lucid: a destructive migration command in production
|
|
62
|
+
* throws unless `{ force: true }` (CLI `--force`). Pass `false` to opt out.
|
|
63
|
+
*/
|
|
64
|
+
disableRollbacksInProduction?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Skip the migration lock (Adonis Lucid `--disable-locks`). The lock is
|
|
67
|
+
* a `<tableName>_lock` table with an `is_locked` flag (Knex mechanism),
|
|
68
|
+
* so it prevents concurrent migrations on every dialect, SQLite too.
|
|
69
|
+
*/
|
|
70
|
+
disableLocks?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Run EVERY migration outside a transaction (Adonis Lucid global
|
|
73
|
+
* `migrations.disableTransactions`). A single migration can also opt out
|
|
74
|
+
* on its own with `static disableTransactions = true`; the effective value
|
|
75
|
+
* is the OR of the two. Defaults to `false` — migrations are wrapped in a
|
|
76
|
+
* transaction for clean, all-or-nothing rollbacks.
|
|
77
|
+
*/
|
|
78
|
+
disableTransactions?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Sort migration files with a numeric-aware comparator (Adonis Lucid
|
|
81
|
+
* `migrations.naturalSort`), so `2_x` orders before `10_x`. Defaults to
|
|
82
|
+
* `false` — plain lexicographic order, which is already correct for the
|
|
83
|
+
* fixed-width `Date.now()` prefixes `make:migration` generates.
|
|
84
|
+
*/
|
|
85
|
+
naturalSort?: boolean;
|
|
71
86
|
});
|
|
87
|
+
/**
|
|
88
|
+
* Force-clear a stuck migration lock (Adonis Lucid `migration:unlock`). A
|
|
89
|
+
* process killed mid-migrate leaves `is_locked = 1` with a stale token and
|
|
90
|
+
* NO way for a later run to acquire — this unconditionally clears the row so
|
|
91
|
+
* migrations can proceed. Returns `true` if a held lock was cleared.
|
|
92
|
+
*/
|
|
93
|
+
forceUnlock(): Promise<boolean>;
|
|
72
94
|
/** Ensure the ream_migrations tracking table exists. */
|
|
73
95
|
init(): Promise<void>;
|
|
74
96
|
/** Get the status of all migrations. */
|
|
75
97
|
status(): Promise<MigrationStatus[]>;
|
|
76
98
|
/** Run all pending migrations. */
|
|
77
|
-
migrate(
|
|
99
|
+
migrate(options?: {
|
|
100
|
+
schemaPath?: string;
|
|
101
|
+
}): Promise<string[]>;
|
|
78
102
|
/** Rollback the last batch of migrations. */
|
|
79
|
-
rollback(
|
|
103
|
+
rollback(options?: {
|
|
104
|
+
batch?: number;
|
|
105
|
+
force?: boolean;
|
|
106
|
+
}): Promise<string[]>;
|
|
80
107
|
/**
|
|
81
108
|
* Rollback + re-run a specific number of batches (or all if `steps` omitted).
|
|
82
109
|
* `migrate:refresh` in Lucid parlance.
|
|
83
110
|
*
|
|
84
111
|
* @implements Story 32.11
|
|
85
112
|
*/
|
|
86
|
-
refresh(
|
|
113
|
+
refresh(options?: {
|
|
114
|
+
force?: boolean;
|
|
115
|
+
}): Promise<{
|
|
87
116
|
rolled: string[];
|
|
88
117
|
executed: string[];
|
|
89
118
|
}>;
|
|
90
119
|
/**
|
|
91
|
-
* Drop EVERY table
|
|
92
|
-
*
|
|
120
|
+
* Drop EVERY user table directly (no `down()`), then run every migration from
|
|
121
|
+
* scratch. `migrate:fresh` in Lucid parlance.
|
|
122
|
+
*
|
|
123
|
+
* Unlike {@link refresh} (which rolls back by calling each migration's
|
|
124
|
+
* `down()`), `fresh` wipes the tables outright — so it succeeds even when a
|
|
125
|
+
* `down()` is broken or missing, and it also clears orphan tables no migration
|
|
126
|
+
* tracks. This matches Lucid's `migration:fresh`. Views, types and domains are
|
|
127
|
+
* left intact: Lucid gates those behind opt-in flags (`--drop-views` /
|
|
128
|
+
* `--drop-types` / `--drop-domains`), so tables-only is its default.
|
|
93
129
|
*
|
|
94
|
-
*
|
|
130
|
+
* `rolled` is always empty — fresh drops rather than rolls back.
|
|
95
131
|
*/
|
|
96
|
-
fresh(
|
|
132
|
+
fresh(options?: {
|
|
133
|
+
force?: boolean;
|
|
134
|
+
schemaPath?: string;
|
|
135
|
+
}): Promise<{
|
|
97
136
|
rolled: string[];
|
|
98
137
|
executed: string[];
|
|
99
138
|
}>;
|
|
139
|
+
/**
|
|
140
|
+
* Load a schema dump (Adonis Lucid `SchemaDumper` output) into the database —
|
|
141
|
+
* executes every statement in the `.sql` file in order, recreating the tables
|
|
142
|
+
* AND the migration bookkeeping rows. Used by `--schema-path`; also callable
|
|
143
|
+
* directly to seed a fresh database from a committed dump.
|
|
144
|
+
*/
|
|
145
|
+
loadDump(sqlPath: string): Promise<void>;
|
|
146
|
+
/**
|
|
147
|
+
* Drop every user table — INCLUDING the migrations tracking table (Lucid's
|
|
148
|
+
* `db:wipe`). `fresh()` calls this and then re-migrates; a caller can use it
|
|
149
|
+
* directly to reset a database to empty.
|
|
150
|
+
*
|
|
151
|
+
* Inter-table foreign keys are handled per dialect: Postgres emits
|
|
152
|
+
* `DROP TABLE … CASCADE`; MySQL and SQLite suspend FK checks for the
|
|
153
|
+
* duration (they don't accept/respect CASCADE on `DROP TABLE`), restored
|
|
154
|
+
* even if a drop throws.
|
|
155
|
+
*/
|
|
156
|
+
wipe(options?: {
|
|
157
|
+
force?: boolean;
|
|
158
|
+
}): Promise<void>;
|
|
100
159
|
/**
|
|
101
160
|
* Rollback every applied batch (alias for `migrate:reset`).
|
|
102
161
|
* Returns the list of rolled-back migration names (in rollback order).
|
|
103
162
|
*/
|
|
104
|
-
reset(
|
|
163
|
+
reset(options?: {
|
|
164
|
+
force?: boolean;
|
|
165
|
+
}): Promise<string[]>;
|
|
105
166
|
/**
|
|
106
167
|
* Dry-run: compute the SQL statements that would be emitted by a migrate
|
|
107
168
|
* without executing them. Returns the full list of statements per pending
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MigrationRunner.d.ts","sourceRoot":"","sources":["../../src/schema/MigrationRunner.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"MigrationRunner.d.ts","sourceRoot":"","sources":["../../src/schema/MigrationRunner.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,OAAO,EAAE,KAAK,YAAY,EAA0B,MAAM,oBAAoB,CAAC;AAM/E,OAAO,EACN,KAAK,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