@capacitor-community/sqlite 5.6.0 → 5.6.1-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.
@@ -69,10 +69,35 @@ class UtilsBinding {
69
69
  let data: Data = Data(value)
70
70
  sqlite3_bind_blob(handle, Int32(idx), data.bytes,
71
71
  Int32(data.bytes.count), SQLITETRANSIENT)
72
+ } else if let value = value {
73
+ let isDict = checkTypeDict(from: value)
74
+ if isDict {
75
+
76
+ let sortedValues = extractSortedValues(from: value as! [String : Int])
77
+ let data: Data = Data(sortedValues)
78
+ sqlite3_bind_blob(handle, Int32(idx), data.bytes,
79
+ Int32(data.bytes.count), SQLITETRANSIENT)
80
+ }
81
+
72
82
  } else {
73
83
  throw UtilsSQLCipherError.bindFailed
74
84
  }
75
85
 
76
86
  }
77
87
  // swiftlint:enable cyclomatic_complexity
88
+ class func extractSortedValues(from queryValues: [String: Int]) -> [UInt8] {
89
+ // Extract keys and sort them
90
+ let sortedKeys = queryValues.keys.sorted { $0.localizedStandardCompare($1) == .orderedAscending }
91
+
92
+ // Extract corresponding values and sort them based on keys
93
+ let sortedValues = sortedKeys.compactMap { UInt8(queryValues[$0] ?? 0) }
94
+
95
+ return sortedValues
96
+ }
97
+ class func checkTypeDict(from value: Any) -> Bool {
98
+ guard value is [String: Int] else {
99
+ return false
100
+ }
101
+ return true
102
+ }
78
103
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor-community/sqlite",
3
- "version": "5.6.0",
3
+ "version": "5.6.1-2",
4
4
  "description": "Community plugin for native & electron SQLite databases",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
@@ -97,6 +97,6 @@
97
97
  }
98
98
  },
99
99
  "dependencies": {
100
- "jeep-sqlite": "^2.5.9"
100
+ "jeep-sqlite": "^2.5.10"
101
101
  }
102
102
  }
package/src/web.ts CHANGED
@@ -36,7 +36,6 @@ import type {
36
36
  capSQLiteExtensionPath,
37
37
  capSQLiteExtensionEnable,
38
38
  } from './definitions';
39
- import { Database } from './web-typeorm-utils/database';
40
39
 
41
40
  export class CapacitorSQLiteWeb
42
41
  extends WebPlugin
@@ -44,7 +43,6 @@ export class CapacitorSQLiteWeb
44
43
  {
45
44
  private jeepSqliteElement: any = null;
46
45
  private isWebStoreOpen = false;
47
- private databases: { [databasename: string]: Database } = {};
48
46
 
49
47
  async initWebStore(): Promise<void> {
50
48
  await customElements.whenDefined('jeep-sqlite');
@@ -135,87 +133,38 @@ export class CapacitorSQLiteWeb
135
133
  }
136
134
 
137
135
  async createConnection(options: capConnectionOptions): Promise<void> {
138
- if (typeof window !== 'undefined' && window.document) {
139
- this.ensureJeepSqliteIsAvailable();
140
- this.ensureWebstoreIsOpen();
141
-
142
- try {
143
- await this.jeepSqliteElement.createConnection(options);
144
- return;
145
- } catch (err) {
146
- throw new Error(`${err}`);
147
- }
148
- } else {
149
- // Only for typeOrm to run migration:generate
150
- const optionKeys = Object.keys(options);
151
- let dbName: string | undefined;
152
- if (!optionKeys.includes('database')) {
153
- throw new Error('Must provide a database name');
154
- } else {
155
- dbName = options.database;
156
- }
157
- const connName: string = 'RW_' + dbName;
158
- const databaseConnection: Database = new Database();
159
- this.databases[connName] = databaseConnection;
136
+ this.ensureJeepSqliteIsAvailable();
137
+ this.ensureWebstoreIsOpen();
138
+
139
+ try {
140
+ await this.jeepSqliteElement.createConnection(options);
141
+ return;
142
+ } catch (err) {
143
+ throw new Error(`${err}`);
160
144
  }
161
145
  }
162
146
 
163
147
  async open(options: capSQLiteOptions): Promise<void> {
164
- if (typeof window !== 'undefined' && window.document) {
165
- this.ensureJeepSqliteIsAvailable();
166
- this.ensureWebstoreIsOpen();
167
-
168
- try {
169
- await this.jeepSqliteElement.open(options);
170
- return;
171
- } catch (err) {
172
- throw new Error(`${err}`);
173
- }
174
- } else {
175
- // Only for typeOrm to run migration:generate
176
-
177
- const dbName = options.database ? options.database : '';
178
- if (dbName.length === 0) {
179
- throw new Error('Must provide a database name');
180
- }
181
- const readonly = false;
182
- const connName = readonly ? 'RO_' + dbName : 'RW_' + dbName;
183
- const database = this.getDatabaseConnectionOrThrowError(connName);
184
- try {
185
- await database.open(dbName);
186
- } catch (err) {
187
- throw new Error(`### open ${err}`);
188
- }
148
+ this.ensureJeepSqliteIsAvailable();
149
+ this.ensureWebstoreIsOpen();
150
+
151
+ try {
152
+ await this.jeepSqliteElement.open(options);
153
+ return;
154
+ } catch (err) {
155
+ throw new Error(`${err}`);
189
156
  }
190
157
  }
191
158
 
192
159
  async closeConnection(options: capSQLiteOptions): Promise<void> {
193
- if (typeof window !== 'undefined' && window.document) {
194
- this.ensureJeepSqliteIsAvailable();
195
- this.ensureWebstoreIsOpen();
196
-
197
- try {
198
- await this.jeepSqliteElement.closeConnection(options);
199
- return;
200
- } catch (err) {
201
- throw new Error(`${err}`);
202
- }
203
- } else {
204
- // Only for typeOrm to run migration:generate
205
- const dbName = options.database ? options.database : '';
206
- if (dbName.length === 0) {
207
- throw new Error('Must provide a database name');
208
- }
209
- const readonly = false;
210
- const connName = readonly ? 'RO_' + dbName : 'RW_' + dbName;
211
- const database = this.getDatabaseConnectionOrThrowError(connName);
212
- try {
213
- await database.close();
214
- // remove the connection from dictionary
215
- delete this.databases[connName];
216
- } catch (err) {
217
- throw new Error(`### closeConnection ${err}`);
218
- }
160
+ this.ensureJeepSqliteIsAvailable();
161
+ this.ensureWebstoreIsOpen();
162
+
163
+ try {
164
+ await this.jeepSqliteElement.closeConnection(options);
165
+ return;
166
+ } catch (err) {
167
+ throw new Error(`${err}`);
219
168
  }
220
169
  }
221
170
 
@@ -247,32 +196,16 @@ export class CapacitorSQLiteWeb
247
196
  }
248
197
 
249
198
  async close(options: capSQLiteOptions): Promise<void> {
250
- if (typeof window !== 'undefined' && window.document) {
251
- this.ensureJeepSqliteIsAvailable();
252
- this.ensureWebstoreIsOpen();
253
-
254
- try {
255
- await this.jeepSqliteElement.close(options);
256
- return;
257
- } catch (err) {
258
- throw new Error(`${err}`);
259
- }
260
- } else {
261
- // Only for typeOrm to run migration:generate
262
-
263
- const dbName = options.database ? options.database : '';
264
- if (dbName.length === 0) {
265
- throw new Error('Must provide a database name');
266
- }
267
- const readonly = false;
268
- const connName = readonly ? 'RO_' + dbName : 'RW_' + dbName;
269
- const database = this.getDatabaseConnectionOrThrowError(connName);
270
- try {
271
- await database.close();
272
- } catch (err) {
273
- throw new Error(`### close ${err}`);
274
- }
199
+ this.ensureJeepSqliteIsAvailable();
200
+ this.ensureWebstoreIsOpen();
201
+
202
+ try {
203
+ await this.jeepSqliteElement.close(options);
204
+ return;
205
+ } catch (err) {
206
+ throw new Error(`${err}`);
275
207
  }
208
+
276
209
  }
277
210
  async beginTransaction(options: capSQLiteOptions): Promise<capSQLiteChanges> {
278
211
  this.ensureJeepSqliteIsAvailable();
@@ -343,39 +276,17 @@ export class CapacitorSQLiteWeb
343
276
  }
344
277
 
345
278
  async execute(options: capSQLiteExecuteOptions): Promise<capSQLiteChanges> {
346
- if (typeof window !== 'undefined' && window.document) {
347
- this.ensureJeepSqliteIsAvailable();
348
- this.ensureWebstoreIsOpen();
349
-
350
- try {
351
- const executeResult: capSQLiteChanges =
352
- await this.jeepSqliteElement.execute(options);
353
- return executeResult;
354
- } catch (err) {
355
- throw new Error(`${err}`);
356
- }
357
- } else {
358
- // Only for typeOrm to run migration:generate
359
-
360
- const dbName = options.database ? options.database : '';
361
- if (dbName.length === 0) {
362
- throw new Error('Must provide a database name');
363
- }
364
- const statements = options.statements ? options.statements : '';
365
- if (statements.length === 0) {
366
- return Promise.reject('Must provide raw SQL statements');
367
- }
368
- const readonly = false;
369
- const connName = readonly ? 'RO_' + dbName : 'RW_' + dbName;
370
- const database = this.getDatabaseConnectionOrThrowError(connName);
371
- try {
372
- const ret = await database.executeSQL(statements);
373
- const executeResult: capSQLiteChanges = { changes: { changes: ret } };
374
- return executeResult;
375
- } catch (err) {
376
- throw new Error(`${err}`);
377
- }
279
+ this.ensureJeepSqliteIsAvailable();
280
+ this.ensureWebstoreIsOpen();
281
+
282
+ try {
283
+ const executeResult: capSQLiteChanges =
284
+ await this.jeepSqliteElement.execute(options);
285
+ return executeResult;
286
+ } catch (err) {
287
+ throw new Error(`${err}`);
378
288
  }
289
+
379
290
  }
380
291
 
381
292
  async executeSet(options: capSQLiteSetOptions): Promise<capSQLiteChanges> {
@@ -392,79 +303,29 @@ export class CapacitorSQLiteWeb
392
303
  }
393
304
 
394
305
  async run(options: capSQLiteRunOptions): Promise<capSQLiteChanges> {
395
- if (typeof window !== 'undefined' && window.document) {
396
- this.ensureJeepSqliteIsAvailable();
397
- this.ensureWebstoreIsOpen();
398
-
399
- try {
400
- const runResult: capSQLiteChanges = await this.jeepSqliteElement.run(
401
- options,
402
- );
403
- return runResult;
404
- } catch (err) {
405
- throw new Error(`${err}`);
406
- }
407
- } else {
408
- // Only for typeOrm to run migration:generate
409
-
410
- const dbName = options.database ? options.database : '';
411
- if (dbName.length === 0) {
412
- throw new Error('Must provide a database name');
413
- }
414
- const statement = options.statement ? options.statement : '';
415
- if (statement.length === 0) {
416
- return Promise.reject('Must provide raw SQL statement');
417
- }
418
- const values = options.values ? options.values : [];
419
- const readonly = false;
420
- const returnMode = options.returnMode ? options.returnMode : 'no';
421
-
422
- const connName = readonly ? 'RO_' + dbName : 'RW_' + dbName;
423
- const database = this.getDatabaseConnectionOrThrowError(connName);
424
- try {
425
- const runResult = await database.run(statement, values, returnMode);
426
- return runResult;
427
- } catch (err) {
428
- throw new Error(`${err}`);
429
- }
306
+ this.ensureJeepSqliteIsAvailable();
307
+ this.ensureWebstoreIsOpen();
308
+
309
+ try {
310
+ const runResult: capSQLiteChanges = await this.jeepSqliteElement.run(
311
+ options,
312
+ );
313
+ return runResult;
314
+ } catch (err) {
315
+ throw new Error(`${err}`);
430
316
  }
431
317
  }
432
318
  async query(options: capSQLiteQueryOptions): Promise<capSQLiteValues> {
433
- if (typeof window !== 'undefined' && window.document) {
434
- this.ensureJeepSqliteIsAvailable();
435
- this.ensureWebstoreIsOpen();
436
-
437
- try {
438
- const queryResult: capSQLiteValues = await this.jeepSqliteElement.query(
439
- options,
440
- );
441
- return queryResult;
442
- } catch (err) {
443
- throw new Error(`${err}`);
444
- }
445
- } else {
446
- // Only for typeOrm to run migration:generate
447
- const dbName = options.database ? options.database : '';
448
- if (dbName.length === 0) {
449
- throw new Error('Must provide a database name');
450
- }
451
- const statement = options.statement ? options.statement : '';
452
- if (statement.length === 0) {
453
- return Promise.reject('Must provide raw SQL statement');
454
- }
455
- const values = options.values ? options.values : [];
456
- const readonly = false;
457
- const connName = readonly ? 'RO_' + dbName : 'RW_' + dbName;
458
- const database = this.getDatabaseConnectionOrThrowError(connName);
459
- try {
460
- const queryResult: capSQLiteValues = await database.selectSQL(
461
- statement,
462
- values,
463
- );
464
- return queryResult;
465
- } catch (err) {
466
- throw new Error(`${err}`);
467
- }
319
+ this.ensureJeepSqliteIsAvailable();
320
+ this.ensureWebstoreIsOpen();
321
+
322
+ try {
323
+ const queryResult: capSQLiteValues = await this.jeepSqliteElement.query(
324
+ options,
325
+ );
326
+ return queryResult;
327
+ } catch (err) {
328
+ throw new Error(`${err}`);
468
329
  }
469
330
  }
470
331
  async isDBExists(options: capSQLiteOptions): Promise<capSQLiteResult> {
@@ -694,14 +555,7 @@ export class CapacitorSQLiteWeb
694
555
  );
695
556
  }
696
557
  }
697
- private getDatabaseConnectionOrThrowError(dbName: string): Database {
698
- const databaseNames = Object.keys(this.databases);
699
- if (!databaseNames.includes(dbName)) {
700
- throw new Error(`No connection available for database "${dbName}"`);
701
- }
702
558
 
703
- return this.databases[dbName];
704
- }
705
559
 
706
560
  ////////////////////////////////////
707
561
  ////// UNIMPLEMENTED METHODS
@@ -1,21 +0,0 @@
1
- /************************************************
2
- * Only to be used to run TypeOrm Cli
3
- * migration:generate
4
- * A in-memory database is used
5
- ************************************************
6
- */
7
- import type { capSQLiteChanges, capSQLiteValues } from '../definitions';
8
- export declare class Database {
9
- private _isDBOpen;
10
- private wasmPath;
11
- private sqliteUtil;
12
- private typeOrmDBFolder;
13
- private dbPath;
14
- mDb: any;
15
- constructor();
16
- open(dbName: string): Promise<void>;
17
- close(): Promise<void>;
18
- executeSQL(statements: string): Promise<number>;
19
- run(statement: string, values: any[], returnMode: string): Promise<capSQLiteChanges>;
20
- selectSQL(sql: string, values: any[]): Promise<capSQLiteValues>;
21
- }
@@ -1,91 +0,0 @@
1
- /************************************************
2
- * Only to be used to run TypeOrm Cli
3
- * migration:generate
4
- * A in-memory database is used
5
- ************************************************
6
- */
7
- import { UtilsSQLite } from './utilsSQLite';
8
- export class Database {
9
- constructor() {
10
- this.wasmPath = 'assets';
11
- this.sqliteUtil = new UtilsSQLite();
12
- this.typeOrmDBFolder = this.sqliteUtil.getTypeOrmDBFolder();
13
- this.dbPath = '';
14
- this.mDb = null;
15
- this._isDBOpen = false;
16
- }
17
- async open(dbName) {
18
- try {
19
- this.dbPath = this.sqliteUtil.getTypeOrmDBPath(this.typeOrmDBFolder, `${dbName}SQLite.db`);
20
- this.mDb = await this.sqliteUtil.openOrCreateDatabase(this.wasmPath, this.dbPath);
21
- this._isDBOpen = true;
22
- return Promise.resolve();
23
- }
24
- catch (err) {
25
- return Promise.reject(`Open: ${err}`);
26
- }
27
- }
28
- async close() {
29
- try {
30
- if (this._isDBOpen) {
31
- await this.sqliteUtil.saveDatabase(this.mDb, this.dbPath);
32
- await this.mDb.close();
33
- }
34
- return Promise.resolve();
35
- }
36
- catch (err) {
37
- return Promise.reject(`Close: ${err}`);
38
- }
39
- }
40
- async executeSQL(statements) {
41
- let changes = -1;
42
- try {
43
- if (this._isDBOpen) {
44
- const initChanges = await this.sqliteUtil.dbChanges(this.mDb);
45
- changes = await this.sqliteUtil.execute(this.mDb, statements);
46
- if (changes < 0) {
47
- return Promise.reject(new Error('ExecuteSQL: changes < 0'));
48
- }
49
- changes = (await this.sqliteUtil.dbChanges(this.mDb)) - initChanges;
50
- }
51
- return Promise.resolve(changes);
52
- }
53
- catch (err) {
54
- return Promise.reject(`ExecuteSQL: ${err}`);
55
- }
56
- }
57
- async run(statement, values, returnMode) {
58
- const retRes = { changes: -1, lastId: -1 };
59
- try {
60
- if (this._isDBOpen) {
61
- const initChanges = await this.sqliteUtil.dbChanges(this.mDb);
62
- const retObj = await this.sqliteUtil.run(this.mDb, statement, values, returnMode);
63
- const lastId = retObj['lastId'];
64
- if (lastId < 0) {
65
- return Promise.reject(new Error('RunSQL: lastId < 0'));
66
- }
67
- const changes = (await this.sqliteUtil.dbChanges(this.mDb)) - initChanges;
68
- retRes.changes = changes;
69
- retRes.lastId = lastId;
70
- retRes.values = retObj['values'] ? retObj['values'] : [];
71
- }
72
- return Promise.resolve({ changes: retRes });
73
- }
74
- catch (err) {
75
- return Promise.reject(`Run: ${err}`);
76
- }
77
- }
78
- async selectSQL(sql, values) {
79
- let retArr = [];
80
- try {
81
- if (this._isDBOpen) {
82
- retArr = await this.sqliteUtil.queryAll(this.mDb, sql, values);
83
- }
84
- return Promise.resolve({ values: retArr });
85
- }
86
- catch (err) {
87
- return Promise.reject(`SelectSQL: ${err}`);
88
- }
89
- }
90
- }
91
- //# sourceMappingURL=database.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"database.js","sourceRoot":"","sources":["../../../src/web-typeorm-utils/database.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,OAAO,QAAQ;IAQnB;QANQ,aAAQ,GAAG,QAAQ,CAAC;QACpB,eAAU,GAAgB,IAAI,WAAW,EAAE,CAAC;QAC5C,oBAAe,GAAG,IAAI,CAAC,UAAU,CAAC,kBAAkB,EAAE,CAAC;QACvD,WAAM,GAAG,EAAE,CAAC;QAIlB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;QAChB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;IACzB,CAAC;IACM,KAAK,CAAC,IAAI,CAA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AC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;aAC1D;YACD,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;SAC7C;QAAC,OAAO,GAAG,EAAE;YACZ,OAAO,OAAO,CAAC,MAAM,CAAC,QAAQ,GAAG,EAAE,CAAC,CAAC;SACtC;IACH,CAAC;IACM,KAAK,CAAC,SAAS,CAAC,GAAW,EAAE,MAAa;QAC/C,IAAI,MAAM,GAAU,EAAE,CAAC;QACvB,IAAI;YACF,IAAI,IAAI,CAAC,SAAS,EAAE;gBAClB,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;aAChE;YACD,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;SAC5C;QAAC,OAAO,GAAG,EAAE;YACZ,OAAO,OAAO,CAAC,MAAM,CAAC,cAAc,GAAG,EAAE,CAAC,CAAC;SAC5C;IACH,CAAC;CACF"}
@@ -1,28 +0,0 @@
1
- /************************************************
2
- * Only to be used to run TypeOrm Cli
3
- * migration:generate
4
- * A in-memory database is used
5
- ************************************************
6
- */
7
- export declare class UtilsSQLite {
8
- initSqlJs: any;
9
- FS: any;
10
- OS: any;
11
- Path: any;
12
- private isExists;
13
- private retExists;
14
- constructor();
15
- getTypeOrmDBFolder(): string;
16
- getTypeOrmDBPath(outputFolderPath: string, dbName: string): string;
17
- checkFileExistence(wasmPath: string): Promise<any>;
18
- checkFolderExistence(folder: string): Promise<boolean>;
19
- openOrCreateDatabase(wasmPath: string, databasePath: string): Promise<any>;
20
- saveDatabase(mDb: any, outputPath: string): Promise<void>;
21
- closeDB(mDB: any): Promise<void>;
22
- dbChanges(mDB: any): Promise<number>;
23
- getLastId(mDB: any): Promise<number>;
24
- execute(mDB: any, sql: string): Promise<number>;
25
- run(mDB: any, statement: string, values: any[], returnMode: string): Promise<any>;
26
- getReturnedValues(result: any, returnMode: string): any[];
27
- queryAll(mDB: any, sql: string, values: any[]): Promise<any[]>;
28
- }