@nextlyhq/adapter-drizzle 0.0.2-alpha.67 → 0.0.2-alpha.69

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 (63) hide show
  1. package/dist/adapter-BypoOEEN.d.cts +1166 -0
  2. package/dist/adapter-CSP-Ek-L.d.ts +1166 -0
  3. package/dist/index-BYb6cDli.d.ts +1168 -0
  4. package/dist/index-C4HJsfwA.d.cts +1168 -0
  5. package/dist/index.cjs +2258 -2183
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.d.cts +5 -10
  8. package/dist/index.d.ts +5 -10
  9. package/dist/index.mjs +2257 -2181
  10. package/dist/index.mjs.map +1 -1
  11. package/dist/migrations.cjs +345 -146
  12. package/dist/migrations.cjs.map +1 -1
  13. package/dist/migrations.d.cts +93 -110
  14. package/dist/migrations.d.ts +93 -110
  15. package/dist/migrations.mjs +344 -144
  16. package/dist/migrations.mjs.map +1 -1
  17. package/dist/schema/index.cjs +21 -6
  18. package/dist/schema/index.cjs.map +1 -1
  19. package/dist/schema/index.d.cts +5 -116
  20. package/dist/schema/index.d.ts +5 -116
  21. package/dist/schema/index.mjs +20 -4
  22. package/dist/schema/index.mjs.map +1 -1
  23. package/dist/schema-Bkkr3JMC.d.cts +264 -0
  24. package/dist/schema-Bkkr3JMC.d.ts +264 -0
  25. package/dist/schema-name.cjs +34 -12
  26. package/dist/schema-name.cjs.map +1 -1
  27. package/dist/schema-name.d.cts +3 -15
  28. package/dist/schema-name.d.ts +3 -15
  29. package/dist/schema-name.mjs +33 -10
  30. package/dist/schema-name.mjs.map +1 -1
  31. package/dist/text-match.cjs +42 -8
  32. package/dist/text-match.cjs.map +1 -1
  33. package/dist/text-match.d.cts +4 -16
  34. package/dist/text-match.d.ts +4 -16
  35. package/dist/text-match.mjs +41 -6
  36. package/dist/text-match.mjs.map +1 -1
  37. package/dist/types/index.cjs +8 -69
  38. package/dist/types/index.d.cts +3 -225
  39. package/dist/types/index.d.ts +3 -225
  40. package/dist/types/index.mjs +1 -64
  41. package/dist/types-CNyA1oIm.cjs +185 -0
  42. package/dist/types-CNyA1oIm.cjs.map +1 -0
  43. package/dist/types-CaF_5jNk.mjs +150 -0
  44. package/dist/types-CaF_5jNk.mjs.map +1 -0
  45. package/dist/version-check.cjs +116 -133
  46. package/dist/version-check.cjs.map +1 -1
  47. package/dist/version-check.d.cts +46 -47
  48. package/dist/version-check.d.ts +46 -47
  49. package/dist/version-check.mjs +115 -131
  50. package/dist/version-check.mjs.map +1 -1
  51. package/package.json +12 -16
  52. package/dist/adapter-bUAaPzjV.d.cts +0 -1143
  53. package/dist/adapter-iJ5hbUvL.d.ts +0 -1143
  54. package/dist/core-CVO7WYDj.d.cts +0 -74
  55. package/dist/core-CVO7WYDj.d.ts +0 -74
  56. package/dist/error-BrdknH2s.d.cts +0 -122
  57. package/dist/error-BrdknH2s.d.ts +0 -122
  58. package/dist/migration-BqHebSwM.d.ts +0 -831
  59. package/dist/migration-Bu0WLdX4.d.cts +0 -831
  60. package/dist/schema-BDn8WfSL.d.cts +0 -200
  61. package/dist/schema-BIQ0YQZ_.d.ts +0 -200
  62. package/dist/types/index.cjs.map +0 -1
  63. package/dist/types/index.mjs.map +0 -1
@@ -1,22 +1,5 @@
1
- import { D as DrizzleAdapter } from './adapter-bUAaPzjV.cjs';
2
- import { M as MigrationRecord, a as Migration, b as MigrationStatus, c as MigrationOptions } from './migration-Bu0WLdX4.cjs';
3
- export { d as MigrationResult } from './migration-Bu0WLdX4.cjs';
4
- import 'drizzle-orm';
5
- import './core-CVO7WYDj.cjs';
6
- import './schema-BDn8WfSL.cjs';
7
- import './error-BrdknH2s.cjs';
8
-
9
- /**
10
- * Database migration utilities.
11
- *
12
- * @remarks
13
- * Provides core utilities for migration management including checksum calculation,
14
- * sorting, filtering, and validation. Also includes optional helpers for adapters
15
- * to use for common migration operations.
16
- *
17
- * @packageDocumentation
18
- */
19
-
1
+ import { t as DrizzleAdapter } from "./adapter-BypoOEEN.cjs";
2
+ import { _ as MigrationOptions, b as MigrationStatus, g as Migration, v as MigrationRecord, y as MigrationResult } from "./index-C4HJsfwA.cjs";
20
3
  /**
21
4
  * Calculate SHA-256 checksum for a migration.
22
5
  *
@@ -43,7 +26,7 @@ import './error-BrdknH2s.cjs';
43
26
  *
44
27
  * @public
45
28
  */
46
- declare function calculateChecksum(migration: Migration): string;
29
+ export declare function calculateChecksum(migration: Migration): string;
47
30
  /**
48
31
  * Sort migrations by timestamp in ascending order.
49
32
  *
@@ -68,7 +51,7 @@ declare function calculateChecksum(migration: Migration): string;
68
51
  *
69
52
  * @public
70
53
  */
71
- declare function sortMigrations(migrations: Migration[]): Migration[];
54
+ export declare function sortMigrations(migrations: Migration[]): Migration[];
72
55
  /**
73
56
  * Filter migrations to get only pending (unapplied) migrations.
74
57
  *
@@ -99,7 +82,7 @@ declare function sortMigrations(migrations: Migration[]): Migration[];
99
82
  *
100
83
  * @public
101
84
  */
102
- declare function filterPending(migrations: Migration[], applied: MigrationRecord[]): Migration[];
85
+ export declare function filterPending(migrations: Migration[], applied: MigrationRecord[]): Migration[];
103
86
  /**
104
87
  * Filter migration records to get only those that match given migrations.
105
88
  *
@@ -131,7 +114,7 @@ declare function filterPending(migrations: Migration[], applied: MigrationRecord
131
114
  *
132
115
  * @public
133
116
  */
134
- declare function filterApplied(migrations: Migration[], applied: MigrationRecord[]): MigrationRecord[];
117
+ export declare function filterApplied(migrations: Migration[], applied: MigrationRecord[]): MigrationRecord[];
135
118
  /**
136
119
  * Validate that a migration's checksum matches its applied record.
137
120
  *
@@ -159,7 +142,7 @@ declare function filterApplied(migrations: Migration[], applied: MigrationRecord
159
142
  *
160
143
  * @public
161
144
  */
162
- declare function validateChecksum(migration: Migration, record: MigrationRecord): boolean;
145
+ export declare function validateChecksum(migration: Migration, record: MigrationRecord): boolean;
163
146
  /**
164
147
  * Detect migrations that have been modified after being applied.
165
148
  *
@@ -186,7 +169,7 @@ declare function validateChecksum(migration: Migration, record: MigrationRecord)
186
169
  *
187
170
  * @public
188
171
  */
189
- declare function detectModified(migrations: Migration[], applied: MigrationRecord[]): MigrationRecord[];
172
+ export declare function detectModified(migrations: Migration[], applied: MigrationRecord[]): MigrationRecord[];
190
173
  /**
191
174
  * Get comprehensive migration status.
192
175
  *
@@ -207,23 +190,23 @@ declare function detectModified(migrations: Migration[], applied: MigrationRecor
207
190
  *
208
191
  * @public
209
192
  */
210
- declare function getMigrationStatus(migrations: Migration[], applied: MigrationRecord[]): MigrationStatus;
193
+ export declare function getMigrationStatus(migrations: Migration[], applied: MigrationRecord[]): MigrationStatus;
211
194
  /**
212
195
  * Validation result for migrations.
213
196
  *
214
197
  * @public
215
198
  */
216
- interface MigrationValidationResult {
217
- /** Whether all validations passed */
218
- valid: boolean;
219
- /** List of validation errors */
220
- errors: string[];
221
- /** List of validation warnings */
222
- warnings: string[];
223
- /** Migrations that have been modified */
224
- modified: MigrationRecord[];
225
- /** Duplicate migration IDs found */
226
- duplicates: string[];
199
+ export interface MigrationValidationResult {
200
+ /** Whether all validations passed */
201
+ valid: boolean;
202
+ /** List of validation errors */
203
+ errors: string[];
204
+ /** List of validation warnings */
205
+ warnings: string[];
206
+ /** Migrations that have been modified */
207
+ modified: MigrationRecord[];
208
+ /** Duplicate migration IDs found */
209
+ duplicates: string[];
227
210
  }
228
211
  /**
229
212
  * Validate migrations for common issues.
@@ -254,7 +237,7 @@ interface MigrationValidationResult {
254
237
  *
255
238
  * @public
256
239
  */
257
- declare function validateMigrations(migrations: Migration[], applied: MigrationRecord[], options?: MigrationOptions): MigrationValidationResult;
240
+ export declare function validateMigrations(migrations: Migration[], applied: MigrationRecord[], options?: MigrationOptions): MigrationValidationResult;
258
241
  /**
259
242
  * Helper functions for managing migrations in database adapters.
260
243
  *
@@ -267,75 +250,75 @@ declare function validateMigrations(migrations: Migration[], applied: MigrationR
267
250
  *
268
251
  * @public
269
252
  */
270
- interface MigrationHelpers {
271
- /**
272
- * Create the migrations tracking table if it doesn't exist.
273
- *
274
- * @remarks
275
- * Creates a table named `nextly_migrations` with columns:
276
- * - id (string, primary key)
277
- * - name (string)
278
- * - applied_at (timestamp)
279
- * - checksum (string, optional)
280
- *
281
- * Uses CREATE TABLE IF NOT EXISTS for safety.
282
- *
283
- * @param adapter - Database adapter to use
284
- * @returns Promise that resolves when table is created
285
- */
286
- createMigrationsTable(adapter: DrizzleAdapter): Promise<void>;
287
- /**
288
- * Get all applied migration records from the database.
289
- *
290
- * @remarks
291
- * Queries the `nextly_migrations` table and returns all records
292
- * sorted by applied_at descending (most recent first).
293
- *
294
- * @param adapter - Database adapter to use
295
- * @returns Promise with array of applied migration records
296
- */
297
- getAppliedMigrations(adapter: DrizzleAdapter): Promise<MigrationRecord[]>;
298
- /**
299
- * Record a migration as applied in the database.
300
- *
301
- * @remarks
302
- * Inserts a new record into the `nextly_migrations` table with:
303
- * - Migration ID, name
304
- * - Current timestamp for applied_at
305
- * - Calculated checksum
306
- *
307
- * Should be called within a transaction during migration execution.
308
- *
309
- * @param adapter - Database adapter to use
310
- * @param migration - Migration that was applied
311
- * @returns Promise that resolves when record is inserted
312
- */
313
- recordMigration(adapter: DrizzleAdapter, migration: Migration): Promise<void>;
314
- /**
315
- * Remove a migration record from the database.
316
- *
317
- * @remarks
318
- * Deletes a record from the `nextly_migrations` table.
319
- * Used during migration rollback operations.
320
- *
321
- * Should be called within a transaction during rollback.
322
- *
323
- * @param adapter - Database adapter to use
324
- * @param migrationId - ID of the migration to remove
325
- * @returns Promise that resolves when record is deleted
326
- */
327
- removeMigrationRecord(adapter: DrizzleAdapter, migrationId: string): Promise<void>;
328
- /**
329
- * Check if migrations table exists.
330
- *
331
- * @remarks
332
- * Queries database metadata to check if the `nextly_migrations` table exists.
333
- * Useful for determining if initialization is needed.
334
- *
335
- * @param adapter - Database adapter to use
336
- * @returns Promise with boolean indicating if table exists
337
- */
338
- migrationsTableExists(adapter: DrizzleAdapter): Promise<boolean>;
253
+ export interface MigrationHelpers {
254
+ /**
255
+ * Create the migrations tracking table if it doesn't exist.
256
+ *
257
+ * @remarks
258
+ * Creates a table named `nextly_migrations` with columns:
259
+ * - id (string, primary key)
260
+ * - name (string)
261
+ * - applied_at (timestamp)
262
+ * - checksum (string, optional)
263
+ *
264
+ * Uses CREATE TABLE IF NOT EXISTS for safety.
265
+ *
266
+ * @param adapter - Database adapter to use
267
+ * @returns Promise that resolves when table is created
268
+ */
269
+ createMigrationsTable(adapter: DrizzleAdapter): Promise<void>;
270
+ /**
271
+ * Get all applied migration records from the database.
272
+ *
273
+ * @remarks
274
+ * Queries the `nextly_migrations` table and returns all records
275
+ * sorted by applied_at descending (most recent first).
276
+ *
277
+ * @param adapter - Database adapter to use
278
+ * @returns Promise with array of applied migration records
279
+ */
280
+ getAppliedMigrations(adapter: DrizzleAdapter): Promise<MigrationRecord[]>;
281
+ /**
282
+ * Record a migration as applied in the database.
283
+ *
284
+ * @remarks
285
+ * Inserts a new record into the `nextly_migrations` table with:
286
+ * - Migration ID, name
287
+ * - Current timestamp for applied_at
288
+ * - Calculated checksum
289
+ *
290
+ * Should be called within a transaction during migration execution.
291
+ *
292
+ * @param adapter - Database adapter to use
293
+ * @param migration - Migration that was applied
294
+ * @returns Promise that resolves when record is inserted
295
+ */
296
+ recordMigration(adapter: DrizzleAdapter, migration: Migration): Promise<void>;
297
+ /**
298
+ * Remove a migration record from the database.
299
+ *
300
+ * @remarks
301
+ * Deletes a record from the `nextly_migrations` table.
302
+ * Used during migration rollback operations.
303
+ *
304
+ * Should be called within a transaction during rollback.
305
+ *
306
+ * @param adapter - Database adapter to use
307
+ * @param migrationId - ID of the migration to remove
308
+ * @returns Promise that resolves when record is deleted
309
+ */
310
+ removeMigrationRecord(adapter: DrizzleAdapter, migrationId: string): Promise<void>;
311
+ /**
312
+ * Check if migrations table exists.
313
+ *
314
+ * @remarks
315
+ * Queries database metadata to check if the `nextly_migrations` table exists.
316
+ * Useful for determining if initialization is needed.
317
+ *
318
+ * @param adapter - Database adapter to use
319
+ * @returns Promise with boolean indicating if table exists
320
+ */
321
+ migrationsTableExists(adapter: DrizzleAdapter): Promise<boolean>;
339
322
  }
340
323
  /**
341
324
  * Implementation of migration helpers.
@@ -347,6 +330,6 @@ interface MigrationHelpers {
347
330
  *
348
331
  * @public
349
332
  */
350
- declare const migrationHelpers: MigrationHelpers;
351
-
352
- export { Migration, type MigrationHelpers, MigrationOptions, MigrationRecord, MigrationStatus, type MigrationValidationResult, calculateChecksum, detectModified, filterApplied, filterPending, getMigrationStatus, migrationHelpers, sortMigrations, validateChecksum, validateMigrations };
333
+ export declare const migrationHelpers: MigrationHelpers;
334
+ export type { Migration, MigrationOptions, MigrationRecord, MigrationResult, MigrationStatus };
335
+ //# sourceMappingURL=migrations.d.cts.map
@@ -1,22 +1,5 @@
1
- import { D as DrizzleAdapter } from './adapter-iJ5hbUvL.js';
2
- import { M as MigrationRecord, a as Migration, b as MigrationStatus, c as MigrationOptions } from './migration-BqHebSwM.js';
3
- export { d as MigrationResult } from './migration-BqHebSwM.js';
4
- import 'drizzle-orm';
5
- import './core-CVO7WYDj.js';
6
- import './schema-BIQ0YQZ_.js';
7
- import './error-BrdknH2s.js';
8
-
9
- /**
10
- * Database migration utilities.
11
- *
12
- * @remarks
13
- * Provides core utilities for migration management including checksum calculation,
14
- * sorting, filtering, and validation. Also includes optional helpers for adapters
15
- * to use for common migration operations.
16
- *
17
- * @packageDocumentation
18
- */
19
-
1
+ import { t as DrizzleAdapter } from "./adapter-CSP-Ek-L.js";
2
+ import { _ as MigrationOptions, b as MigrationStatus, g as Migration, v as MigrationRecord, y as MigrationResult } from "./index-BYb6cDli.js";
20
3
  /**
21
4
  * Calculate SHA-256 checksum for a migration.
22
5
  *
@@ -43,7 +26,7 @@ import './error-BrdknH2s.js';
43
26
  *
44
27
  * @public
45
28
  */
46
- declare function calculateChecksum(migration: Migration): string;
29
+ export declare function calculateChecksum(migration: Migration): string;
47
30
  /**
48
31
  * Sort migrations by timestamp in ascending order.
49
32
  *
@@ -68,7 +51,7 @@ declare function calculateChecksum(migration: Migration): string;
68
51
  *
69
52
  * @public
70
53
  */
71
- declare function sortMigrations(migrations: Migration[]): Migration[];
54
+ export declare function sortMigrations(migrations: Migration[]): Migration[];
72
55
  /**
73
56
  * Filter migrations to get only pending (unapplied) migrations.
74
57
  *
@@ -99,7 +82,7 @@ declare function sortMigrations(migrations: Migration[]): Migration[];
99
82
  *
100
83
  * @public
101
84
  */
102
- declare function filterPending(migrations: Migration[], applied: MigrationRecord[]): Migration[];
85
+ export declare function filterPending(migrations: Migration[], applied: MigrationRecord[]): Migration[];
103
86
  /**
104
87
  * Filter migration records to get only those that match given migrations.
105
88
  *
@@ -131,7 +114,7 @@ declare function filterPending(migrations: Migration[], applied: MigrationRecord
131
114
  *
132
115
  * @public
133
116
  */
134
- declare function filterApplied(migrations: Migration[], applied: MigrationRecord[]): MigrationRecord[];
117
+ export declare function filterApplied(migrations: Migration[], applied: MigrationRecord[]): MigrationRecord[];
135
118
  /**
136
119
  * Validate that a migration's checksum matches its applied record.
137
120
  *
@@ -159,7 +142,7 @@ declare function filterApplied(migrations: Migration[], applied: MigrationRecord
159
142
  *
160
143
  * @public
161
144
  */
162
- declare function validateChecksum(migration: Migration, record: MigrationRecord): boolean;
145
+ export declare function validateChecksum(migration: Migration, record: MigrationRecord): boolean;
163
146
  /**
164
147
  * Detect migrations that have been modified after being applied.
165
148
  *
@@ -186,7 +169,7 @@ declare function validateChecksum(migration: Migration, record: MigrationRecord)
186
169
  *
187
170
  * @public
188
171
  */
189
- declare function detectModified(migrations: Migration[], applied: MigrationRecord[]): MigrationRecord[];
172
+ export declare function detectModified(migrations: Migration[], applied: MigrationRecord[]): MigrationRecord[];
190
173
  /**
191
174
  * Get comprehensive migration status.
192
175
  *
@@ -207,23 +190,23 @@ declare function detectModified(migrations: Migration[], applied: MigrationRecor
207
190
  *
208
191
  * @public
209
192
  */
210
- declare function getMigrationStatus(migrations: Migration[], applied: MigrationRecord[]): MigrationStatus;
193
+ export declare function getMigrationStatus(migrations: Migration[], applied: MigrationRecord[]): MigrationStatus;
211
194
  /**
212
195
  * Validation result for migrations.
213
196
  *
214
197
  * @public
215
198
  */
216
- interface MigrationValidationResult {
217
- /** Whether all validations passed */
218
- valid: boolean;
219
- /** List of validation errors */
220
- errors: string[];
221
- /** List of validation warnings */
222
- warnings: string[];
223
- /** Migrations that have been modified */
224
- modified: MigrationRecord[];
225
- /** Duplicate migration IDs found */
226
- duplicates: string[];
199
+ export interface MigrationValidationResult {
200
+ /** Whether all validations passed */
201
+ valid: boolean;
202
+ /** List of validation errors */
203
+ errors: string[];
204
+ /** List of validation warnings */
205
+ warnings: string[];
206
+ /** Migrations that have been modified */
207
+ modified: MigrationRecord[];
208
+ /** Duplicate migration IDs found */
209
+ duplicates: string[];
227
210
  }
228
211
  /**
229
212
  * Validate migrations for common issues.
@@ -254,7 +237,7 @@ interface MigrationValidationResult {
254
237
  *
255
238
  * @public
256
239
  */
257
- declare function validateMigrations(migrations: Migration[], applied: MigrationRecord[], options?: MigrationOptions): MigrationValidationResult;
240
+ export declare function validateMigrations(migrations: Migration[], applied: MigrationRecord[], options?: MigrationOptions): MigrationValidationResult;
258
241
  /**
259
242
  * Helper functions for managing migrations in database adapters.
260
243
  *
@@ -267,75 +250,75 @@ declare function validateMigrations(migrations: Migration[], applied: MigrationR
267
250
  *
268
251
  * @public
269
252
  */
270
- interface MigrationHelpers {
271
- /**
272
- * Create the migrations tracking table if it doesn't exist.
273
- *
274
- * @remarks
275
- * Creates a table named `nextly_migrations` with columns:
276
- * - id (string, primary key)
277
- * - name (string)
278
- * - applied_at (timestamp)
279
- * - checksum (string, optional)
280
- *
281
- * Uses CREATE TABLE IF NOT EXISTS for safety.
282
- *
283
- * @param adapter - Database adapter to use
284
- * @returns Promise that resolves when table is created
285
- */
286
- createMigrationsTable(adapter: DrizzleAdapter): Promise<void>;
287
- /**
288
- * Get all applied migration records from the database.
289
- *
290
- * @remarks
291
- * Queries the `nextly_migrations` table and returns all records
292
- * sorted by applied_at descending (most recent first).
293
- *
294
- * @param adapter - Database adapter to use
295
- * @returns Promise with array of applied migration records
296
- */
297
- getAppliedMigrations(adapter: DrizzleAdapter): Promise<MigrationRecord[]>;
298
- /**
299
- * Record a migration as applied in the database.
300
- *
301
- * @remarks
302
- * Inserts a new record into the `nextly_migrations` table with:
303
- * - Migration ID, name
304
- * - Current timestamp for applied_at
305
- * - Calculated checksum
306
- *
307
- * Should be called within a transaction during migration execution.
308
- *
309
- * @param adapter - Database adapter to use
310
- * @param migration - Migration that was applied
311
- * @returns Promise that resolves when record is inserted
312
- */
313
- recordMigration(adapter: DrizzleAdapter, migration: Migration): Promise<void>;
314
- /**
315
- * Remove a migration record from the database.
316
- *
317
- * @remarks
318
- * Deletes a record from the `nextly_migrations` table.
319
- * Used during migration rollback operations.
320
- *
321
- * Should be called within a transaction during rollback.
322
- *
323
- * @param adapter - Database adapter to use
324
- * @param migrationId - ID of the migration to remove
325
- * @returns Promise that resolves when record is deleted
326
- */
327
- removeMigrationRecord(adapter: DrizzleAdapter, migrationId: string): Promise<void>;
328
- /**
329
- * Check if migrations table exists.
330
- *
331
- * @remarks
332
- * Queries database metadata to check if the `nextly_migrations` table exists.
333
- * Useful for determining if initialization is needed.
334
- *
335
- * @param adapter - Database adapter to use
336
- * @returns Promise with boolean indicating if table exists
337
- */
338
- migrationsTableExists(adapter: DrizzleAdapter): Promise<boolean>;
253
+ export interface MigrationHelpers {
254
+ /**
255
+ * Create the migrations tracking table if it doesn't exist.
256
+ *
257
+ * @remarks
258
+ * Creates a table named `nextly_migrations` with columns:
259
+ * - id (string, primary key)
260
+ * - name (string)
261
+ * - applied_at (timestamp)
262
+ * - checksum (string, optional)
263
+ *
264
+ * Uses CREATE TABLE IF NOT EXISTS for safety.
265
+ *
266
+ * @param adapter - Database adapter to use
267
+ * @returns Promise that resolves when table is created
268
+ */
269
+ createMigrationsTable(adapter: DrizzleAdapter): Promise<void>;
270
+ /**
271
+ * Get all applied migration records from the database.
272
+ *
273
+ * @remarks
274
+ * Queries the `nextly_migrations` table and returns all records
275
+ * sorted by applied_at descending (most recent first).
276
+ *
277
+ * @param adapter - Database adapter to use
278
+ * @returns Promise with array of applied migration records
279
+ */
280
+ getAppliedMigrations(adapter: DrizzleAdapter): Promise<MigrationRecord[]>;
281
+ /**
282
+ * Record a migration as applied in the database.
283
+ *
284
+ * @remarks
285
+ * Inserts a new record into the `nextly_migrations` table with:
286
+ * - Migration ID, name
287
+ * - Current timestamp for applied_at
288
+ * - Calculated checksum
289
+ *
290
+ * Should be called within a transaction during migration execution.
291
+ *
292
+ * @param adapter - Database adapter to use
293
+ * @param migration - Migration that was applied
294
+ * @returns Promise that resolves when record is inserted
295
+ */
296
+ recordMigration(adapter: DrizzleAdapter, migration: Migration): Promise<void>;
297
+ /**
298
+ * Remove a migration record from the database.
299
+ *
300
+ * @remarks
301
+ * Deletes a record from the `nextly_migrations` table.
302
+ * Used during migration rollback operations.
303
+ *
304
+ * Should be called within a transaction during rollback.
305
+ *
306
+ * @param adapter - Database adapter to use
307
+ * @param migrationId - ID of the migration to remove
308
+ * @returns Promise that resolves when record is deleted
309
+ */
310
+ removeMigrationRecord(adapter: DrizzleAdapter, migrationId: string): Promise<void>;
311
+ /**
312
+ * Check if migrations table exists.
313
+ *
314
+ * @remarks
315
+ * Queries database metadata to check if the `nextly_migrations` table exists.
316
+ * Useful for determining if initialization is needed.
317
+ *
318
+ * @param adapter - Database adapter to use
319
+ * @returns Promise with boolean indicating if table exists
320
+ */
321
+ migrationsTableExists(adapter: DrizzleAdapter): Promise<boolean>;
339
322
  }
340
323
  /**
341
324
  * Implementation of migration helpers.
@@ -347,6 +330,6 @@ interface MigrationHelpers {
347
330
  *
348
331
  * @public
349
332
  */
350
- declare const migrationHelpers: MigrationHelpers;
351
-
352
- export { Migration, type MigrationHelpers, MigrationOptions, MigrationRecord, MigrationStatus, type MigrationValidationResult, calculateChecksum, detectModified, filterApplied, filterPending, getMigrationStatus, migrationHelpers, sortMigrations, validateChecksum, validateMigrations };
333
+ export declare const migrationHelpers: MigrationHelpers;
334
+ export type { Migration, MigrationOptions, MigrationRecord, MigrationResult, MigrationStatus };
335
+ //# sourceMappingURL=migrations.d.ts.map