You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
console.log(`${symbols.success} No schema changes detected.`);
61
53
}
62
54
55
+
if(status.has_tampered_data){
56
+
console.log(
57
+
`${symbols.error} The database schema has been modified by other means than 'sam migrate'. Please undo any DDL changes you've made and instead change the schema file and/or create a migration file`,
Copy file name to clipboardExpand all lines: lib/database.mjs
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -264,9 +264,9 @@ export class Database {
264
264
/**
265
265
* Prepares a SQL query with parameters and returns a prepared statement.
266
266
* @param {string} sql the SQL query to prepare
267
-
* @param {Params} params the parameters to bind to the query. Supports a dictionary with `:name`, `@name` and `$name` style parameters, or an array with `?` position based parameters.
267
+
* @param {Params | Params[]} params the parameters to bind to the query. Supports a dictionary with `:name`, `@name` and `$name` style parameters, or an array with `?` position based parameters.
268
268
* @template [Row=any] - the type of the row object that is returned
269
-
* @template {any[]} [Params=any[]] - the type of the parameters that can be bound to the prepared statement
269
+
* @template {any[] | Object} [Params=any] - the type of the parameters that can be bound to the prepared statement
270
270
* @returns {Promise<Statement<Row, Params>} a promise that resolves to a {@link Statement} object representing the prepared statement
271
271
* @throws {Error} if the query cannot be prepared
272
272
* @see {@link sqlite3.Database#prepare}
@@ -309,7 +309,7 @@ export class Database {
309
309
/**
310
310
* Represents a prepared statement. Async wrapper around the sqlite3.Statement class.
311
311
* @template [Row=any] - the type of the row object that is returned
312
-
* @template {any[]} [Params=any[]] - the type of the parameters that can be bound to the prepared statement
312
+
* @template {any[] | Object} [Params=any[]] - the type of the parameters that can be bound to the prepared statement
313
313
*/
314
314
exportclassStatement{
315
315
/**
@@ -330,7 +330,7 @@ export class Statement {
330
330
331
331
/**
332
332
* Binds parameters to the prepared statement. Completely resets the row cursor and removes any previously bound parameters.
333
-
* @param {Params} params the parameters to bind to the prepared statement. Supports a dictionary with `:name`, `@name` and `$name` style parameters, or an array with `?` position based parameters.
333
+
* @param {Params | Params[]} params the parameters to bind to the prepared statement. Supports a dictionary with `:name`, `@name` and `$name` style parameters, or an array with `?` position based parameters.
334
334
* @returns {Promise<void>} a promise that resolves when the parameters have been bound
335
335
* @throws {Error} if the parameters cannot be bound
336
336
* @see {@link sqlite3.Statement#bind}
@@ -391,7 +391,7 @@ export class Statement {
391
391
392
392
/**
393
393
* Runs the prepared statement with the optional bound parameters (overwriting any previously bound parameters when supplied).
394
-
* @param {Params} params the parameters to bind to the prepared statement. Supports a dictionary with `:name`, `@name` and `$name` style parameters, or an array with `?` position based parameters.
394
+
* @param {Params | Params[]} params the parameters to bind to the prepared statement. Supports a dictionary with `:name`, `@name` and `$name` style parameters, or an array with `?` position based parameters.
395
395
* @returns {Promise<RunResult>} a promise that resolves to a {@link RunResult} object with a `lastID` property and a `changes` property
396
396
* @throws {Error} if the prepared statement cannot be run
397
397
* @see {@link sqlite3.Statement#run}
@@ -413,7 +413,7 @@ export class Statement {
413
413
414
414
/**
415
415
* Gets a single row from the prepared statement with the optional bound parameters (overwriting any previously bound parameters when supplied).
416
-
* @param {Params} params the parameters to bind to the prepared statement. Supports a dictionary with `:name`, `@name` and `$name` style parameters, or an array with `?` position based parameters.
416
+
* @param {Params | Params[]} params the parameters to bind to the prepared statement. Supports a dictionary with `:name`, `@name` and `$name` style parameters, or an array with `?` position based parameters.
417
417
* @returns {Promise<Row | undefined>} a promise that resolves to the first row returned by the prepared statement or undefined if no rows are returned
418
418
* @throws {Error} if the prepared statement cannot be run
419
419
* @see {@link sqlite3.Statement#get}
@@ -434,7 +434,7 @@ export class Statement {
434
434
435
435
/**
436
436
* Gets all rows from the prepared statement with the optional bound parameters (overwriting any previously bound parameters when supplied).
437
-
* @param {Params} params the parameters to bind to the prepared statement. Supports a dictionary with `:name`, `@name` and `$name` style parameters, or an array with `?` position based parameters.
437
+
* @param {Params | Params[]} params the parameters to bind to the prepared statement. Supports a dictionary with `:name`, `@name` and `$name` style parameters, or an array with `?` position based parameters.
438
438
* @returns {Promise<Row[]>} a promise that resolves to all rows returned by the prepared statement
439
439
* @throws {Error} if the prepared statement cannot be run
440
440
* @see {@link sqlite3.Statement#all}
@@ -455,7 +455,7 @@ export class Statement {
455
455
456
456
/**
457
457
* Runs the prepared statement with the optional bound parameters (overwriting any previously bound parameters when supplied) and returns the rows one by one as an async generator (useful for saving memory with large query results).
458
-
* @param {Params} params the parameters to bind to the prepared statement. Supports a dictionary with `:name`, `@name` and `$name` style parameters, or an array with `?` position based parameters.
458
+
* @param {Params | Params[]} params the parameters to bind to the prepared statement. Supports a dictionary with `:name`, `@name` and `$name` style parameters, or an array with `?` position based parameters.
459
459
* @returns {AsyncGenerator<Row, void, undefined>} an async generator that yields each row returned by the prepared statement
460
460
* @throws {Error} if the prepared statement cannot be run
461
461
* @example <caption>Using the async generator</caption>
0 commit comments