@capacitor-community/sqlite 4.2.2-1 → 4.2.2
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 +1 -0
- package/electron/dist/plugin.js +12 -17
- package/electron/dist/plugin.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
package/electron/dist/plugin.js
CHANGED
|
@@ -218,19 +218,15 @@ class UtilsSQLite {
|
|
|
218
218
|
* BeginTransaction
|
|
219
219
|
* @param db
|
|
220
220
|
* @param isOpen
|
|
221
|
-
* @param mode
|
|
222
221
|
*/
|
|
223
|
-
async beginTransaction(db, isOpen
|
|
222
|
+
async beginTransaction(db, isOpen) {
|
|
224
223
|
// eslint-disable-next-line no-async-promise-executor
|
|
225
224
|
return new Promise((resolve, reject) => {
|
|
226
225
|
const msg = 'BeginTransaction: ';
|
|
227
226
|
if (!isOpen) {
|
|
228
227
|
return Promise.reject(`${msg}database not opened`);
|
|
229
228
|
}
|
|
230
|
-
|
|
231
|
-
if (mode.slice(0, 3) === "wal") {
|
|
232
|
-
sql = "BEGIN CONCURRENT";
|
|
233
|
-
}
|
|
229
|
+
const sql = 'BEGIN TRANSACTION;';
|
|
234
230
|
db.run(sql, (err) => {
|
|
235
231
|
if (err) {
|
|
236
232
|
reject(`${msg}${err.message}`);
|
|
@@ -949,8 +945,7 @@ class UtilsJson {
|
|
|
949
945
|
let changes = 0;
|
|
950
946
|
try {
|
|
951
947
|
// start a transaction
|
|
952
|
-
|
|
953
|
-
await this.sqliteUtil.beginTransaction(mDB, true, mode);
|
|
948
|
+
await this.sqliteUtil.beginTransaction(mDB, true);
|
|
954
949
|
}
|
|
955
950
|
catch (err) {
|
|
956
951
|
return Promise.reject(`CreateDatabaseSchema: ${err}`);
|
|
@@ -2586,8 +2581,7 @@ class ImportFromJson {
|
|
|
2586
2581
|
try {
|
|
2587
2582
|
initChanges = await this.sqliteUtil.dbChanges(mDB);
|
|
2588
2583
|
// start a transaction
|
|
2589
|
-
|
|
2590
|
-
await this.sqliteUtil.beginTransaction(mDB, true, mode);
|
|
2584
|
+
await this.sqliteUtil.beginTransaction(mDB, true);
|
|
2591
2585
|
}
|
|
2592
2586
|
catch (err) {
|
|
2593
2587
|
return Promise.reject(`createTablesData: ${err}`);
|
|
@@ -2647,8 +2641,7 @@ class ImportFromJson {
|
|
|
2647
2641
|
try {
|
|
2648
2642
|
initChanges = await this.sqliteUtil.dbChanges(mDB);
|
|
2649
2643
|
// start a transaction
|
|
2650
|
-
|
|
2651
|
-
await this.sqliteUtil.beginTransaction(mDB, true, mode);
|
|
2644
|
+
await this.sqliteUtil.beginTransaction(mDB, true);
|
|
2652
2645
|
}
|
|
2653
2646
|
catch (err) {
|
|
2654
2647
|
return Promise.reject(`createViews: ${err}`);
|
|
@@ -3298,8 +3291,7 @@ class UtilsUpgrade {
|
|
|
3298
3291
|
*/
|
|
3299
3292
|
async executeStatementsProcess(mDB, statements) {
|
|
3300
3293
|
try {
|
|
3301
|
-
|
|
3302
|
-
await this.sqliteUtil.beginTransaction(mDB, true, mode);
|
|
3294
|
+
await this.sqliteUtil.beginTransaction(mDB, true);
|
|
3303
3295
|
for (const statement of statements) {
|
|
3304
3296
|
await this.sqliteUtil.execute(mDB, statement, false);
|
|
3305
3297
|
}
|
|
@@ -3611,7 +3603,8 @@ class Database {
|
|
|
3611
3603
|
try {
|
|
3612
3604
|
if (transaction) {
|
|
3613
3605
|
const mode = await this.sqliteUtil.getJournalMode(this.database);
|
|
3614
|
-
|
|
3606
|
+
console.log(`$$$ in executeSQL journal_mode: ${mode} $$$`);
|
|
3607
|
+
await this.sqliteUtil.beginTransaction(this.database, this._isDbOpen);
|
|
3615
3608
|
}
|
|
3616
3609
|
const changes = await this.sqliteUtil.execute(this.database, sql, false);
|
|
3617
3610
|
if (changes < 0) {
|
|
@@ -3668,7 +3661,8 @@ class Database {
|
|
|
3668
3661
|
// start a transaction
|
|
3669
3662
|
if (transaction) {
|
|
3670
3663
|
const mode = await this.sqliteUtil.getJournalMode(this.database);
|
|
3671
|
-
|
|
3664
|
+
console.log(`$$$ in runSQL journal_mode: ${mode} $$$`);
|
|
3665
|
+
await this.sqliteUtil.beginTransaction(this.database, this._isDbOpen);
|
|
3672
3666
|
}
|
|
3673
3667
|
}
|
|
3674
3668
|
catch (err) {
|
|
@@ -3712,7 +3706,8 @@ class Database {
|
|
|
3712
3706
|
// start a transaction
|
|
3713
3707
|
if (transaction) {
|
|
3714
3708
|
const mode = await this.sqliteUtil.getJournalMode(this.database);
|
|
3715
|
-
|
|
3709
|
+
console.log(`$$$ in execSet journal_mode: ${mode} $$$`);
|
|
3710
|
+
await this.sqliteUtil.beginTransaction(this.database, this._isDbOpen);
|
|
3716
3711
|
}
|
|
3717
3712
|
}
|
|
3718
3713
|
catch (err) {
|