@livestore/wa-sqlite 1.0.1-dev.12 → 1.0.1-dev.13
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/package.json +1 -1
- package/src/sqlite-api.js +5 -9
- package/src/types/index.d.ts +1 -1
package/package.json
CHANGED
package/src/sqlite-api.js
CHANGED
|
@@ -458,7 +458,7 @@ export function Factory(Module) {
|
|
|
458
458
|
// return SQLite.SQLITE_OK;
|
|
459
459
|
// };
|
|
460
460
|
sqlite3.exec = function(db, sql, callback) {
|
|
461
|
-
const
|
|
461
|
+
const stmts = sqlite3.statements(db, sql);
|
|
462
462
|
for (const stmt of stmts) {
|
|
463
463
|
let columns;
|
|
464
464
|
while (sqlite3.step(stmt) === SQLite.SQLITE_ROW) {
|
|
@@ -469,7 +469,9 @@ export function Factory(Module) {
|
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
|
-
|
|
472
|
+
for (const stmt of stmts) {
|
|
473
|
+
sqlite3.finalize(stmt);
|
|
474
|
+
}
|
|
473
475
|
return SQLite.SQLITE_OK;
|
|
474
476
|
};
|
|
475
477
|
|
|
@@ -778,13 +780,7 @@ export function Factory(Module) {
|
|
|
778
780
|
// }
|
|
779
781
|
// }
|
|
780
782
|
|
|
781
|
-
|
|
782
|
-
while (onFinally.length) {
|
|
783
|
-
onFinally.pop()();
|
|
784
|
-
}
|
|
785
|
-
}
|
|
786
|
-
|
|
787
|
-
return { stmts, finalize };
|
|
783
|
+
return stmts;
|
|
788
784
|
};
|
|
789
785
|
|
|
790
786
|
sqlite3.step = (function() {
|
package/src/types/index.d.ts
CHANGED
|
@@ -759,7 +759,7 @@ interface SQLiteAPI {
|
|
|
759
759
|
* @param options
|
|
760
760
|
*/
|
|
761
761
|
// statements(db: number, sql: string, options?: SQLitePrepareOptions): AsyncIterable<number>;
|
|
762
|
-
statements(db: number, sql: string, options?: SQLitePrepareOptions):
|
|
762
|
+
statements(db: number, sql: string, options?: SQLitePrepareOptions): ReadonlyArray<number>;
|
|
763
763
|
|
|
764
764
|
/**
|
|
765
765
|
* Evaluate an SQL statement
|