@remix-run/data-table 0.2.1 → 0.4.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 (113) hide show
  1. package/README.md +251 -123
  2. package/dist/cli.d.ts +54 -0
  3. package/dist/cli.d.ts.map +1 -0
  4. package/dist/cli.js +53 -0
  5. package/dist/index.d.ts +5 -4
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +7 -7
  8. package/dist/lib/column.d.ts +1 -1
  9. package/dist/lib/column.d.ts.map +1 -1
  10. package/dist/lib/column.js +10 -1
  11. package/dist/lib/database/execution-context.d.ts +5 -5
  12. package/dist/lib/database/execution-context.d.ts.map +1 -1
  13. package/dist/lib/database/execution-context.js +1 -0
  14. package/dist/lib/database/helpers.js +6 -6
  15. package/dist/lib/database/query-execution.d.ts.map +1 -1
  16. package/dist/lib/database/query-execution.js +17 -17
  17. package/dist/lib/database/relations.js +5 -5
  18. package/dist/lib/database/write-lifecycle.d.ts +2 -2
  19. package/dist/lib/database/write-lifecycle.d.ts.map +1 -1
  20. package/dist/lib/database/write-lifecycle.js +5 -5
  21. package/dist/lib/database.d.ts +74 -59
  22. package/dist/lib/database.d.ts.map +1 -1
  23. package/dist/lib/database.js +176 -83
  24. package/dist/lib/driver.d.ts +287 -0
  25. package/dist/lib/driver.d.ts.map +1 -0
  26. package/dist/lib/errors.d.ts +2 -2
  27. package/dist/lib/errors.d.ts.map +1 -1
  28. package/dist/lib/errors.js +4 -4
  29. package/dist/lib/migrations/directive.d.ts +12 -0
  30. package/dist/lib/migrations/directive.d.ts.map +1 -0
  31. package/dist/lib/migrations/directive.js +28 -0
  32. package/dist/lib/migrations/directory-name.d.ts +12 -0
  33. package/dist/lib/migrations/directory-name.d.ts.map +1 -0
  34. package/dist/lib/migrations/directory-name.js +18 -0
  35. package/dist/lib/migrations/journal-store.d.ts +7 -7
  36. package/dist/lib/migrations/journal-store.d.ts.map +1 -1
  37. package/dist/lib/migrations/journal-store.js +37 -28
  38. package/dist/lib/migrations/registry.d.ts +1 -1
  39. package/dist/lib/migrations/registry.js +1 -1
  40. package/dist/lib/migrations/runner.d.ts +12 -19
  41. package/dist/lib/migrations/runner.d.ts.map +1 -1
  42. package/dist/lib/migrations/runner.js +170 -175
  43. package/dist/lib/migrations-node.d.ts +26 -5
  44. package/dist/lib/migrations-node.d.ts.map +1 -1
  45. package/dist/lib/migrations-node.js +73 -41
  46. package/dist/lib/migrations.d.ts +63 -209
  47. package/dist/lib/migrations.d.ts.map +1 -1
  48. package/dist/lib/migrations.js +1 -38
  49. package/dist/lib/operators.d.ts +1 -1
  50. package/dist/lib/operators.js +1 -1
  51. package/dist/lib/query.d.ts +34 -1
  52. package/dist/lib/query.d.ts.map +1 -1
  53. package/dist/lib/query.js +32 -4
  54. package/dist/lib/sql-helpers.d.ts +1 -7
  55. package/dist/lib/sql-helpers.d.ts.map +1 -1
  56. package/dist/lib/sql-helpers.js +0 -16
  57. package/dist/lib/sql.d.ts +1 -1
  58. package/dist/lib/sql.js +1 -1
  59. package/dist/lib/table.d.ts +1 -1
  60. package/dist/lib/table.d.ts.map +1 -1
  61. package/dist/lib/table.js +5 -5
  62. package/dist/migrations/node.d.ts +1 -1
  63. package/dist/migrations/node.d.ts.map +1 -1
  64. package/dist/migrations/node.js +1 -1
  65. package/dist/migrations.d.ts +2 -6
  66. package/dist/migrations.d.ts.map +1 -1
  67. package/dist/migrations.js +2 -5
  68. package/dist/operators.js +1 -1
  69. package/dist/sql-helpers.d.ts +1 -1
  70. package/dist/sql-helpers.d.ts.map +1 -1
  71. package/dist/sql-helpers.js +1 -1
  72. package/package.json +13 -9
  73. package/src/cli.ts +120 -0
  74. package/src/index.ts +20 -54
  75. package/src/lib/column.ts +14 -2
  76. package/src/lib/database/execution-context.ts +10 -6
  77. package/src/lib/database/helpers.ts +1 -1
  78. package/src/lib/database/query-execution.ts +15 -11
  79. package/src/lib/database/write-lifecycle.ts +4 -4
  80. package/src/lib/database.ts +223 -96
  81. package/src/lib/driver.ts +333 -0
  82. package/src/lib/errors.ts +4 -4
  83. package/src/lib/migrations/directive.ts +38 -0
  84. package/src/lib/migrations/directory-name.ts +23 -0
  85. package/src/lib/migrations/journal-store.ts +42 -28
  86. package/src/lib/migrations/registry.ts +1 -1
  87. package/src/lib/migrations/runner.ts +224 -205
  88. package/src/lib/migrations-node.ts +80 -38
  89. package/src/lib/migrations.ts +62 -228
  90. package/src/lib/operators.ts +1 -1
  91. package/src/lib/query.ts +34 -1
  92. package/src/lib/sql-helpers.ts +1 -22
  93. package/src/lib/sql.ts +1 -1
  94. package/src/lib/table.ts +1 -1
  95. package/src/migrations/node.ts +1 -1
  96. package/src/migrations.ts +5 -16
  97. package/src/sql-helpers.ts +0 -1
  98. package/dist/lib/adapter.d.ts +0 -550
  99. package/dist/lib/adapter.d.ts.map +0 -1
  100. package/dist/lib/migrations/filename.d.ts +0 -12
  101. package/dist/lib/migrations/filename.d.ts.map +0 -1
  102. package/dist/lib/migrations/filename.js +0 -20
  103. package/dist/lib/migrations/helpers.d.ts +0 -11
  104. package/dist/lib/migrations/helpers.d.ts.map +0 -1
  105. package/dist/lib/migrations/helpers.js +0 -77
  106. package/dist/lib/migrations/schema-api.d.ts +0 -7
  107. package/dist/lib/migrations/schema-api.d.ts.map +0 -1
  108. package/dist/lib/migrations/schema-api.js +0 -326
  109. package/src/lib/adapter.ts +0 -653
  110. package/src/lib/migrations/filename.ts +0 -25
  111. package/src/lib/migrations/helpers.ts +0 -108
  112. package/src/lib/migrations/schema-api.ts +0 -417
  113. /package/dist/lib/{adapter.js → driver.js} +0 -0
@@ -49,16 +49,16 @@ export class DataTableQueryError extends DataTableError {
49
49
  }
50
50
  }
51
51
  /**
52
- * Thrown when adapter execution fails.
52
+ * Thrown when database execution fails.
53
53
  */
54
- export class DataTableAdapterError extends DataTableError {
54
+ export class DataTableDatabaseError extends DataTableError {
55
55
  constructor(message, options) {
56
56
  super(message, {
57
- code: 'DATA_TABLE_ADAPTER_ERROR',
57
+ code: 'DATA_TABLE_DATABASE_ERROR',
58
58
  cause: options?.cause,
59
59
  metadata: options?.metadata,
60
60
  });
61
- this.name = 'DataTableAdapterError';
61
+ this.name = 'DataTableDatabaseError';
62
62
  }
63
63
  }
64
64
  /**
@@ -0,0 +1,12 @@
1
+ import type { MigrationTransactionMode } from '../migrations.ts';
2
+ /**
3
+ * Parses an optional `-- data-table/transaction: auto|required|none` directive
4
+ * from any single-line SQL comment in the script.
5
+ *
6
+ * Returns `undefined` when no directive is present.
7
+ * @param sql SQL script contents.
8
+ * @returns The declared transaction mode, or `undefined` when not declared.
9
+ * @throws when more than one directive is present or the value is invalid.
10
+ */
11
+ export declare function parseTransactionDirective(sql: string): MigrationTransactionMode | undefined;
12
+ //# sourceMappingURL=directive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"directive.d.ts","sourceRoot":"","sources":["../../../src/lib/migrations/directive.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAA;AAIhE;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,GAAG,wBAAwB,GAAG,SAAS,CAwB3F"}
@@ -0,0 +1,28 @@
1
+ const directivePattern = /^\s*--\s*data-table\/transaction\s*:\s*(auto|required|none)\s*$/i;
2
+ /**
3
+ * Parses an optional `-- data-table/transaction: auto|required|none` directive
4
+ * from any single-line SQL comment in the script.
5
+ *
6
+ * Returns `undefined` when no directive is present.
7
+ * @param sql SQL script contents.
8
+ * @returns The declared transaction mode, or `undefined` when not declared.
9
+ * @throws when more than one directive is present or the value is invalid.
10
+ */
11
+ export function parseTransactionDirective(sql) {
12
+ let match;
13
+ for (let line of sql.split(/\r?\n/)) {
14
+ let trimmed = line.trim();
15
+ if (!trimmed.startsWith('--')) {
16
+ continue;
17
+ }
18
+ let result = directivePattern.exec(trimmed);
19
+ if (!result) {
20
+ continue;
21
+ }
22
+ if (match !== undefined) {
23
+ throw new Error('Migration script declares more than one transaction directive');
24
+ }
25
+ match = result[1].toLowerCase();
26
+ }
27
+ return match;
28
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Parses a migration directory name into `{ id, name }`.
3
+ *
4
+ * Expected format: `YYYYMMDDHHmmss_name`.
5
+ * @param name Migration directory basename.
6
+ * @returns Parsed migration id and name.
7
+ */
8
+ export declare function parseMigrationDirectoryName(name: string): {
9
+ id: string;
10
+ name: string;
11
+ };
12
+ //# sourceMappingURL=directory-name.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"directory-name.d.ts","sourceRoot":"","sources":["../../../src/lib/migrations/directory-name.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAatF"}
@@ -0,0 +1,18 @@
1
+ const migrationDirectoryPattern = /^(\d{14})_(.+)$/;
2
+ /**
3
+ * Parses a migration directory name into `{ id, name }`.
4
+ *
5
+ * Expected format: `YYYYMMDDHHmmss_name`.
6
+ * @param name Migration directory basename.
7
+ * @returns Parsed migration id and name.
8
+ */
9
+ export function parseMigrationDirectoryName(name) {
10
+ let match = name.match(migrationDirectoryPattern);
11
+ if (!match) {
12
+ throw new Error('Invalid migration directory name "' + name + '". Expected format YYYYMMDDHHmmss_name');
13
+ }
14
+ return {
15
+ id: match[1],
16
+ name: match[2],
17
+ };
18
+ }
@@ -1,15 +1,15 @@
1
- import type { DatabaseAdapter, TransactionToken } from '../adapter.ts';
1
+ import type { DatabaseDriver, TransactionToken } from '../driver.ts';
2
2
  import type { MigrationDescriptor, MigrationJournalRow } from '../migrations.ts';
3
- export declare function normalizeChecksum(migration: MigrationDescriptor): string;
4
- export declare function ensureMigrationJournal(adapter: DatabaseAdapter, tableName: string): Promise<void>;
5
- export declare function hasMigrationJournal(adapter: DatabaseAdapter, tableName: string): Promise<boolean>;
6
- export declare function loadJournalRows(adapter: DatabaseAdapter, tableName: string): Promise<MigrationJournalRow[]>;
7
- export declare function insertJournalRow(adapter: DatabaseAdapter, tableName: string, row: {
3
+ export declare function computeChecksum(migration: MigrationDescriptor): Promise<string>;
4
+ export declare function ensureMigrationJournal(driver: DatabaseDriver, tableName: string): Promise<void>;
5
+ export declare function hasMigrationJournal(driver: DatabaseDriver, tableName: string): Promise<boolean>;
6
+ export declare function loadJournalRows(driver: DatabaseDriver, tableName: string): Promise<MigrationJournalRow[]>;
7
+ export declare function insertJournalRow(driver: DatabaseDriver, tableName: string, row: {
8
8
  id: string;
9
9
  name: string;
10
10
  checksum: string;
11
11
  batch: number;
12
12
  }, transaction?: TransactionToken): Promise<void>;
13
- export declare function deleteJournalRow(adapter: DatabaseAdapter, tableName: string, id: string, transaction?: TransactionToken): Promise<void>;
13
+ export declare function deleteJournalRow(driver: DatabaseDriver, tableName: string, id: string, transaction?: TransactionToken): Promise<void>;
14
14
  export declare function getBatch(rows: MigrationJournalRow[]): number;
15
15
  //# sourceMappingURL=journal-store.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"journal-store.d.ts","sourceRoot":"","sources":["../../../src/lib/migrations/journal-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAEtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAEhF,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,mBAAmB,GAAG,MAAM,CAMxE;AAED,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,eAAe,EACxB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC,CAef;AAED,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,eAAe,EACxB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,OAAO,CAAC,CAalB;AAED,wBAAsB,eAAe,CACnC,OAAO,EAAE,eAAe,EACxB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAmBhC;AAED,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,eAAe,EACxB,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE;IACH,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;CACd,EACD,WAAW,CAAC,EAAE,gBAAgB,GAC7B,OAAO,CAAC,IAAI,CAAC,CAaf;AAED,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,eAAe,EACxB,SAAS,EAAE,MAAM,EACjB,EAAE,EAAE,MAAM,EACV,WAAW,CAAC,EAAE,gBAAgB,GAC7B,OAAO,CAAC,IAAI,CAAC,CAQf;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,mBAAmB,EAAE,GAAG,MAAM,CAO5D"}
1
+ {"version":3,"file":"journal-store.d.ts","sourceRoot":"","sources":["../../../src/lib/migrations/journal-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAEpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAEhF,wBAAsB,eAAe,CAAC,SAAS,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC,CAGrF;AAYD,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,cAAc,EACtB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC,CAYf;AAED,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,cAAc,EACtB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,OAAO,CAAC,CAuBlB;AAED,wBAAsB,eAAe,CACnC,MAAM,EAAE,cAAc,EACtB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAmBhC;AAED,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,cAAc,EACtB,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE;IACH,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;CACd,EACD,WAAW,CAAC,EAAE,gBAAgB,GAC7B,OAAO,CAAC,IAAI,CAAC,CAaf;AAED,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,cAAc,EACtB,SAAS,EAAE,MAAM,EACjB,EAAE,EAAE,MAAM,EACV,WAAW,CAAC,EAAE,gBAAgB,GAC7B,OAAO,CAAC,IAAI,CAAC,CAQf;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,mBAAmB,EAAE,GAAG,MAAM,CAO5D"}
@@ -1,29 +1,29 @@
1
- import { rawSql } from "../sql.js";
2
- export function normalizeChecksum(migration) {
3
- if (migration.checksum) {
4
- return migration.checksum;
1
+ import { rawSql } from '../sql.js';
2
+ export async function computeChecksum(migration) {
3
+ let digest = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(migration.up));
4
+ return bytesToHex(new Uint8Array(digest));
5
+ }
6
+ function bytesToHex(bytes) {
7
+ let hex = '';
8
+ for (let byte of bytes) {
9
+ hex += byte.toString(16).padStart(2, '0');
5
10
  }
6
- return migration.id + ':' + migration.name;
11
+ return hex;
7
12
  }
8
- export async function ensureMigrationJournal(adapter, tableName) {
9
- await adapter.migrate({
10
- operation: {
11
- kind: 'createTable',
12
- table: { name: tableName },
13
- ifNotExists: true,
14
- columns: {
15
- id: { type: 'varchar', length: 64, nullable: false, primaryKey: true },
16
- name: { type: 'varchar', length: 255, nullable: false },
17
- checksum: { type: 'varchar', length: 128, nullable: false },
18
- batch: { type: 'integer', nullable: false },
19
- applied_at: { type: 'timestamp', nullable: false, default: { kind: 'now' } },
20
- },
21
- },
22
- });
13
+ export async function ensureMigrationJournal(driver, tableName) {
14
+ await driver.executeScript('create table if not exists ' +
15
+ tableName +
16
+ ' (' +
17
+ 'id varchar(64) not null primary key, ' +
18
+ 'name varchar(255) not null, ' +
19
+ 'checksum varchar(128) not null, ' +
20
+ 'batch integer not null, ' +
21
+ 'applied_at timestamp not null default current_timestamp' +
22
+ ')');
23
23
  }
24
- export async function hasMigrationJournal(adapter, tableName) {
24
+ export async function hasMigrationJournal(driver, tableName) {
25
25
  try {
26
- await adapter.execute({
26
+ await driver.execute({
27
27
  operation: {
28
28
  kind: 'raw',
29
29
  sql: rawSql('select 1 from ' + tableName + ' limit 1'),
@@ -32,11 +32,20 @@ export async function hasMigrationJournal(adapter, tableName) {
32
32
  return true;
33
33
  }
34
34
  catch {
35
+ // The probe fails both when the journal table is missing and when the
36
+ // database itself is unreachable. Only the former means "no journal yet";
37
+ // rethrow connection/auth failures via a table-independent query.
38
+ await driver.execute({
39
+ operation: {
40
+ kind: 'raw',
41
+ sql: rawSql('select 1'),
42
+ },
43
+ });
35
44
  return false;
36
45
  }
37
46
  }
38
- export async function loadJournalRows(adapter, tableName) {
39
- let result = await adapter.execute({
47
+ export async function loadJournalRows(driver, tableName) {
48
+ let result = await driver.execute({
40
49
  operation: {
41
50
  kind: 'raw',
42
51
  sql: rawSql('select id, name, checksum, batch, applied_at from ' + tableName + ' order by id asc'),
@@ -51,8 +60,8 @@ export async function loadJournalRows(adapter, tableName) {
51
60
  appliedAt: new Date(String(row.applied_at)),
52
61
  }));
53
62
  }
54
- export async function insertJournalRow(adapter, tableName, row, transaction) {
55
- await adapter.execute({
63
+ export async function insertJournalRow(driver, tableName, row, transaction) {
64
+ await driver.execute({
56
65
  operation: {
57
66
  kind: 'raw',
58
67
  sql: rawSql('insert into ' + tableName + ' (id, name, checksum, batch) values (?, ?, ?, ?)', [
@@ -65,8 +74,8 @@ export async function insertJournalRow(adapter, tableName, row, transaction) {
65
74
  transaction,
66
75
  });
67
76
  }
68
- export async function deleteJournalRow(adapter, tableName, id, transaction) {
69
- await adapter.execute({
77
+ export async function deleteJournalRow(driver, tableName, id, transaction) {
78
+ await driver.execute({
70
79
  operation: {
71
80
  kind: 'raw',
72
81
  sql: rawSql('delete from ' + tableName + ' where id = ?', [id]),
@@ -20,7 +20,7 @@ export declare function resolveMigrations(input: MigrationDescriptor[] | Migrati
20
20
  * import { createMigrationRegistry } from 'remix/data-table/migrations'
21
21
  *
22
22
  * let registry = createMigrationRegistry()
23
- * registry.register({ id, name, migration })
23
+ * registry.register({ id, name, up, down })
24
24
  * ```
25
25
  */
26
26
  export declare function createMigrationRegistry(initial?: MigrationDescriptor[]): MigrationRegistry;
@@ -26,7 +26,7 @@ export function resolveMigrations(input) {
26
26
  * import { createMigrationRegistry } from 'remix/data-table/migrations'
27
27
  *
28
28
  * let registry = createMigrationRegistry()
29
- * registry.register({ id, name, migration })
29
+ * registry.register({ id, name, up, down })
30
30
  * ```
31
31
  */
32
32
  export function createMigrationRegistry(initial = []) {
@@ -1,20 +1,13 @@
1
- import type { DatabaseAdapter } from '../adapter.ts';
2
- import type { MigrationDescriptor, MigrationRegistry, MigrationRunner, MigrationRunnerOptions } from '../migrations.ts';
3
- /**
4
- * Creates a migration runner for applying/reverting migrations against an adapter.
5
- * @param adapter Database adapter used to compile and execute migration operations.
6
- * @param migrations Migration descriptors or registry.
7
- * @param options Optional runner configuration.
8
- * @returns A migration runner instance.
9
- * @example
10
- * ```ts
11
- * import { createMigrationRunner } from 'remix/data-table/migrations'
12
- *
13
- * let runner = createMigrationRunner(adapter, migrations, {
14
- * journalTable: 'app_migrations',
15
- * })
16
- * await runner.up()
17
- * ```
18
- */
19
- export declare function createMigrationRunner(adapter: DatabaseAdapter, migrations: MigrationDescriptor[] | MigrationRegistry, options?: MigrationRunnerOptions): MigrationRunner;
1
+ import type { DatabaseDriver } from '../driver.ts';
2
+ import type { MigrationOperationOptions, MigrateResult, MigrationDescriptor, MigrationRegistry, MigrationStatusEntry } from '../migrations.ts';
3
+ interface MigrationRunnerOptions {
4
+ journalTable?: string;
5
+ }
6
+ interface MigrationRunner {
7
+ up(options?: MigrationOperationOptions): Promise<MigrateResult>;
8
+ down(options?: MigrationOperationOptions): Promise<MigrateResult>;
9
+ status(): Promise<MigrationStatusEntry[]>;
10
+ }
11
+ export declare function createMigrationRunner(driver: DatabaseDriver, migrations: MigrationDescriptor[] | MigrationRegistry, options?: MigrationRunnerOptions): MigrationRunner;
12
+ export {};
20
13
  //# sourceMappingURL=runner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../../src/lib/migrations/runner.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAoB,MAAM,eAAe,CAAA;AAEtE,OAAO,KAAK,EAIV,mBAAmB,EAGnB,iBAAiB,EACjB,eAAe,EACf,sBAAsB,EAGvB,MAAM,kBAAkB,CAAA;AAyRzB;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,eAAe,EACxB,UAAU,EAAE,mBAAmB,EAAE,GAAG,iBAAiB,EACrD,OAAO,GAAE,sBAA2B,GACnC,eAAe,CAwDjB"}
1
+ {"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../../src/lib/migrations/runner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAoB,MAAM,cAAc,CAAA;AACpE,OAAO,KAAK,EACV,yBAAyB,EACzB,aAAa,EACb,mBAAmB,EAGnB,iBAAiB,EAEjB,oBAAoB,EAErB,MAAM,kBAAkB,CAAA;AAEzB,UAAU,sBAAsB;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,UAAU,eAAe;IACvB,EAAE,CAAC,OAAO,CAAC,EAAE,yBAAyB,GAAG,OAAO,CAAC,aAAa,CAAC,CAAA;IAC/D,IAAI,CAAC,OAAO,CAAC,EAAE,yBAAyB,GAAG,OAAO,CAAC,aAAa,CAAC,CAAA;IACjE,MAAM,IAAI,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAAA;CAC1C;AAkSD,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,cAAc,EACtB,UAAU,EAAE,mBAAmB,EAAE,GAAG,iBAAiB,EACrD,OAAO,GAAE,sBAA2B,GACnC,eAAe,CA6EjB"}