@capacitor-community/sqlite 6.0.1 → 6.0.2-dev.ecc62b3.1738008093
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/CapacitorCommunitySqlite.podspec +1 -1
- package/README.md +71 -91
- package/android/build.gradle +9 -9
- package/android/src/main/java/com/getcapacitor/community/database/sqlite/CapacitorSQLite.java +11 -13
- package/android/src/main/java/com/getcapacitor/community/database/sqlite/CapacitorSQLitePlugin.java +15 -22
- package/android/src/main/java/com/getcapacitor/community/database/sqlite/SQLite/Database.java +2 -1
- package/android/src/main/java/com/getcapacitor/community/database/sqlite/SQLite/ImportExportJson/ExportToJson.java +5 -6
- package/android/src/main/java/com/getcapacitor/community/database/sqlite/SQLite/ImportExportJson/ImportFromJson.java +117 -117
- package/android/src/main/java/com/getcapacitor/community/database/sqlite/SQLite/UtilsBiometric.java +27 -31
- package/android/src/main/java/com/getcapacitor/community/database/sqlite/SQLite/UtilsDownloadFromHTTP.java +13 -12
- package/android/src/main/java/com/getcapacitor/community/database/sqlite/SQLite/UtilsFile.java +2 -1
- package/dist/esm/definitions.js +1 -3
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +2 -6
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +2 -6
- package/dist/plugin.js.map +1 -1
- package/electron/dist/plugin.js +6197 -6164
- package/electron/dist/plugin.js.map +1 -1
- package/electron/{rollup.config.js → rollup.config.mjs} +1 -3
- package/ios/Plugin/CapacitorSQLite.swift +5 -5
- package/ios/Plugin/Database.swift +1 -1
- package/ios/Plugin/ImportExportJson/ExportToJson.swift +7 -7
- package/ios/Plugin/Models/KeychainServices.swift +1 -1
- package/ios/Plugin/Utils/UtilsBinding.swift +2 -2
- package/ios/Plugin/Utils/UtilsDelete.swift +4 -4
- package/ios/Plugin/Utils/UtilsDownloadFromHTTP.swift +2 -2
- package/ios/Plugin/Utils/UtilsDrop.swift +1 -1
- package/ios/Plugin/Utils/UtilsSQLCipher.swift +17 -17
- package/ios/Plugin/Utils/UtilsSQLStatement.swift +120 -121
- package/package.json +27 -25
- package/src/definitions.ts +37 -117
- package/src/index.ts +4 -8
- package/src/web.ts +59 -131
package/src/definitions.ts
CHANGED
|
@@ -376,18 +376,14 @@ export interface CapacitorSQLitePlugin {
|
|
|
376
376
|
* @returns Promise<capSQLiteResult>
|
|
377
377
|
* @since 3.0.0-beta.11
|
|
378
378
|
*/
|
|
379
|
-
checkConnectionsConsistency(
|
|
380
|
-
options: capAllConnectionsOptions,
|
|
381
|
-
): Promise<capSQLiteResult>;
|
|
379
|
+
checkConnectionsConsistency(options: capAllConnectionsOptions): Promise<capSQLiteResult>;
|
|
382
380
|
/**
|
|
383
381
|
* get a non conformed database path
|
|
384
382
|
* @param options capNCDatabasePathOptions
|
|
385
383
|
* @return Promise<capNCDatabasePathResult>
|
|
386
384
|
* @since 3.3.3-1
|
|
387
385
|
*/
|
|
388
|
-
getNCDatabasePath(
|
|
389
|
-
options: capNCDatabasePathOptions,
|
|
390
|
-
): Promise<capNCDatabasePathResult>;
|
|
386
|
+
getNCDatabasePath(options: capNCDatabasePathOptions): Promise<capNCDatabasePathResult>;
|
|
391
387
|
/**
|
|
392
388
|
* create a non conformed database connection
|
|
393
389
|
* @param options capNCConnectionOptions
|
|
@@ -1117,10 +1113,7 @@ export interface ISQLiteConnection {
|
|
|
1117
1113
|
* @returns Promise<void>
|
|
1118
1114
|
* @since 3.0.0-beta.13
|
|
1119
1115
|
*/
|
|
1120
|
-
changeEncryptionSecret(
|
|
1121
|
-
passphrase: string,
|
|
1122
|
-
oldpassphrase: string,
|
|
1123
|
-
): Promise<void>;
|
|
1116
|
+
changeEncryptionSecret(passphrase: string, oldpassphrase: string): Promise<void>;
|
|
1124
1117
|
/**
|
|
1125
1118
|
* Clear the passphrase in a secure store
|
|
1126
1119
|
* @returns Promise<void>
|
|
@@ -1137,14 +1130,11 @@ export interface ISQLiteConnection {
|
|
|
1137
1130
|
/**
|
|
1138
1131
|
* Add the upgrade Statement for database version upgrading
|
|
1139
1132
|
* @param database
|
|
1140
|
-
* @param upgrade @since 5.6.4
|
|
1133
|
+
* @param upgrade @since 5.6.4
|
|
1141
1134
|
* @returns Promise<void>
|
|
1142
1135
|
* @since 2.9.0 refactor
|
|
1143
1136
|
*/
|
|
1144
|
-
addUpgradeStatement(
|
|
1145
|
-
database: string,
|
|
1146
|
-
upgrade: capSQLiteVersionUpgrade[]
|
|
1147
|
-
): Promise<void>;
|
|
1137
|
+
addUpgradeStatement(database: string, upgrade: capSQLiteVersionUpgrade[]): Promise<void>;
|
|
1148
1138
|
/**
|
|
1149
1139
|
* Create a connection to a database
|
|
1150
1140
|
* @param database
|
|
@@ -1177,10 +1167,7 @@ export interface ISQLiteConnection {
|
|
|
1177
1167
|
* @returns Promise<SQLiteDBConnection>
|
|
1178
1168
|
* @since 2.9.0 refactor
|
|
1179
1169
|
*/
|
|
1180
|
-
retrieveConnection(
|
|
1181
|
-
database: string,
|
|
1182
|
-
readonly: boolean,
|
|
1183
|
-
): Promise<SQLiteDBConnection>;
|
|
1170
|
+
retrieveConnection(database: string, readonly: boolean): Promise<SQLiteDBConnection>;
|
|
1184
1171
|
/**
|
|
1185
1172
|
* Retrieve all database connections
|
|
1186
1173
|
* @returns Promise<Map<string, SQLiteDBConnection>>
|
|
@@ -1216,10 +1203,7 @@ export interface ISQLiteConnection {
|
|
|
1216
1203
|
* @returns Promise<capNCDatabasePathResult>
|
|
1217
1204
|
* @since 3.3.3-1
|
|
1218
1205
|
*/
|
|
1219
|
-
getNCDatabasePath(
|
|
1220
|
-
path: string,
|
|
1221
|
-
database: string,
|
|
1222
|
-
): Promise<capNCDatabasePathResult>;
|
|
1206
|
+
getNCDatabasePath(path: string, database: string): Promise<capNCDatabasePathResult>;
|
|
1223
1207
|
/**
|
|
1224
1208
|
* Create a non-conformed database connection
|
|
1225
1209
|
* @param databasePath
|
|
@@ -1227,10 +1211,7 @@ export interface ISQLiteConnection {
|
|
|
1227
1211
|
* @returns Promise<SQLiteDBConnection>
|
|
1228
1212
|
* @since 3.3.3-1
|
|
1229
1213
|
*/
|
|
1230
|
-
createNCConnection(
|
|
1231
|
-
databasePath: string,
|
|
1232
|
-
version: number,
|
|
1233
|
-
): Promise<SQLiteDBConnection>;
|
|
1214
|
+
createNCConnection(databasePath: string, version: number): Promise<SQLiteDBConnection>;
|
|
1234
1215
|
/**
|
|
1235
1216
|
* Close a non-conformed database connection
|
|
1236
1217
|
* @param databasePath
|
|
@@ -1351,10 +1332,7 @@ export interface ISQLiteConnection {
|
|
|
1351
1332
|
* @param folderPath the origin from where to move the databases
|
|
1352
1333
|
* @param dbNameList the names of the databases to move, check out the getMigratableDbList to get a list, an empty list will result in copying all the databases with '.db' extension.
|
|
1353
1334
|
*/
|
|
1354
|
-
moveDatabasesAndAddSuffix(
|
|
1355
|
-
folderPath?: string,
|
|
1356
|
-
dbNameList?: string[],
|
|
1357
|
-
): Promise<void>;
|
|
1335
|
+
moveDatabasesAndAddSuffix(folderPath?: string, dbNameList?: string[]): Promise<void>;
|
|
1358
1336
|
}
|
|
1359
1337
|
/**
|
|
1360
1338
|
* SQLiteConnection Class
|
|
@@ -1423,10 +1401,7 @@ export class SQLiteConnection implements ISQLiteConnection {
|
|
|
1423
1401
|
return Promise.reject(err);
|
|
1424
1402
|
}
|
|
1425
1403
|
}
|
|
1426
|
-
async changeEncryptionSecret(
|
|
1427
|
-
passphrase: string,
|
|
1428
|
-
oldpassphrase: string,
|
|
1429
|
-
): Promise<void> {
|
|
1404
|
+
async changeEncryptionSecret(passphrase: string, oldpassphrase: string): Promise<void> {
|
|
1430
1405
|
try {
|
|
1431
1406
|
await this.sqlite.changeEncryptionSecret({
|
|
1432
1407
|
passphrase: passphrase,
|
|
@@ -1455,10 +1430,7 @@ export class SQLiteConnection implements ISQLiteConnection {
|
|
|
1455
1430
|
return Promise.reject(err);
|
|
1456
1431
|
}
|
|
1457
1432
|
}
|
|
1458
|
-
async addUpgradeStatement(
|
|
1459
|
-
database: string,
|
|
1460
|
-
upgrade: capSQLiteVersionUpgrade[]
|
|
1461
|
-
): Promise<void> {
|
|
1433
|
+
async addUpgradeStatement(database: string, upgrade: capSQLiteVersionUpgrade[]): Promise<void> {
|
|
1462
1434
|
try {
|
|
1463
1435
|
if (database.endsWith('.db')) database = database.slice(0, -3);
|
|
1464
1436
|
await this.sqlite.addUpgradeStatement({
|
|
@@ -1516,20 +1488,14 @@ export class SQLiteConnection implements ISQLiteConnection {
|
|
|
1516
1488
|
return Promise.reject(err);
|
|
1517
1489
|
}
|
|
1518
1490
|
}
|
|
1519
|
-
async isConnection(
|
|
1520
|
-
database: string,
|
|
1521
|
-
readonly: boolean,
|
|
1522
|
-
): Promise<capSQLiteResult> {
|
|
1491
|
+
async isConnection(database: string, readonly: boolean): Promise<capSQLiteResult> {
|
|
1523
1492
|
const res: capSQLiteResult = {} as capSQLiteResult;
|
|
1524
1493
|
if (database.endsWith('.db')) database = database.slice(0, -3);
|
|
1525
1494
|
const connName = readonly ? `RO_${database}` : `RW_${database}`;
|
|
1526
1495
|
res.result = this._connectionDict.has(connName);
|
|
1527
1496
|
return Promise.resolve(res);
|
|
1528
1497
|
}
|
|
1529
|
-
async retrieveConnection(
|
|
1530
|
-
database: string,
|
|
1531
|
-
readonly: boolean,
|
|
1532
|
-
): Promise<SQLiteDBConnection> {
|
|
1498
|
+
async retrieveConnection(database: string, readonly: boolean): Promise<SQLiteDBConnection> {
|
|
1533
1499
|
if (database.endsWith('.db')) database = database.slice(0, -3);
|
|
1534
1500
|
const connName = readonly ? `RO_${database}` : `RW_${database}`;
|
|
1535
1501
|
if (this._connectionDict.has(connName)) {
|
|
@@ -1542,25 +1508,18 @@ export class SQLiteConnection implements ISQLiteConnection {
|
|
|
1542
1508
|
return Promise.reject(`Connection ${database} does not exist`);
|
|
1543
1509
|
}
|
|
1544
1510
|
}
|
|
1545
|
-
async getNCDatabasePath(
|
|
1546
|
-
path: string,
|
|
1547
|
-
database: string,
|
|
1548
|
-
): Promise<capNCDatabasePathResult> {
|
|
1511
|
+
async getNCDatabasePath(path: string, database: string): Promise<capNCDatabasePathResult> {
|
|
1549
1512
|
try {
|
|
1550
|
-
const databasePath: capNCDatabasePathResult =
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
});
|
|
1513
|
+
const databasePath: capNCDatabasePathResult = await this.sqlite.getNCDatabasePath({
|
|
1514
|
+
path,
|
|
1515
|
+
database,
|
|
1516
|
+
});
|
|
1555
1517
|
return Promise.resolve(databasePath);
|
|
1556
1518
|
} catch (err) {
|
|
1557
1519
|
return Promise.reject(err);
|
|
1558
1520
|
}
|
|
1559
1521
|
}
|
|
1560
|
-
async createNCConnection(
|
|
1561
|
-
databasePath: string,
|
|
1562
|
-
version: number,
|
|
1563
|
-
): Promise<SQLiteDBConnection> {
|
|
1522
|
+
async createNCConnection(databasePath: string, version: number): Promise<SQLiteDBConnection> {
|
|
1564
1523
|
try {
|
|
1565
1524
|
await this.sqlite.createNCConnection({
|
|
1566
1525
|
databasePath,
|
|
@@ -1590,9 +1549,7 @@ export class SQLiteConnection implements ISQLiteConnection {
|
|
|
1590
1549
|
res.result = this._connectionDict.has(connName);
|
|
1591
1550
|
return Promise.resolve(res);
|
|
1592
1551
|
}
|
|
1593
|
-
async retrieveNCConnection(
|
|
1594
|
-
databasePath: string,
|
|
1595
|
-
): Promise<SQLiteDBConnection> {
|
|
1552
|
+
async retrieveNCConnection(databasePath: string): Promise<SQLiteDBConnection> {
|
|
1596
1553
|
if (this._connectionDict.has(databasePath)) {
|
|
1597
1554
|
const connName = `RO_${databasePath})`;
|
|
1598
1555
|
const conn = this._connectionDict.get(connName);
|
|
@@ -1648,11 +1605,10 @@ export class SQLiteConnection implements ISQLiteConnection {
|
|
|
1648
1605
|
openModes.push(key.substring(0, 2));
|
|
1649
1606
|
dbNames.push(key.substring(3));
|
|
1650
1607
|
}
|
|
1651
|
-
const res: capSQLiteResult =
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
});
|
|
1608
|
+
const res: capSQLiteResult = await this.sqlite.checkConnectionsConsistency({
|
|
1609
|
+
dbNames: dbNames,
|
|
1610
|
+
openModes: openModes,
|
|
1611
|
+
});
|
|
1656
1612
|
if (!res.result) this._connectionDict = new Map();
|
|
1657
1613
|
return Promise.resolve(res);
|
|
1658
1614
|
} catch (err) {
|
|
@@ -1751,10 +1707,7 @@ export class SQLiteConnection implements ISQLiteConnection {
|
|
|
1751
1707
|
return Promise.reject(err);
|
|
1752
1708
|
}
|
|
1753
1709
|
}
|
|
1754
|
-
async addSQLiteSuffix(
|
|
1755
|
-
folderPath?: string,
|
|
1756
|
-
dbNameList?: string[],
|
|
1757
|
-
): Promise<void> {
|
|
1710
|
+
async addSQLiteSuffix(folderPath?: string, dbNameList?: string[]): Promise<void> {
|
|
1758
1711
|
const path: string = folderPath ? folderPath : 'default';
|
|
1759
1712
|
const dbList: string[] = dbNameList ? dbNameList : [];
|
|
1760
1713
|
try {
|
|
@@ -1767,10 +1720,7 @@ export class SQLiteConnection implements ISQLiteConnection {
|
|
|
1767
1720
|
return Promise.reject(err);
|
|
1768
1721
|
}
|
|
1769
1722
|
}
|
|
1770
|
-
async deleteOldDatabases(
|
|
1771
|
-
folderPath?: string,
|
|
1772
|
-
dbNameList?: string[],
|
|
1773
|
-
): Promise<void> {
|
|
1723
|
+
async deleteOldDatabases(folderPath?: string, dbNameList?: string[]): Promise<void> {
|
|
1774
1724
|
const path: string = folderPath ? folderPath : 'default';
|
|
1775
1725
|
const dbList: string[] = dbNameList ? dbNameList : [];
|
|
1776
1726
|
try {
|
|
@@ -1784,10 +1734,7 @@ export class SQLiteConnection implements ISQLiteConnection {
|
|
|
1784
1734
|
}
|
|
1785
1735
|
}
|
|
1786
1736
|
|
|
1787
|
-
async moveDatabasesAndAddSuffix(
|
|
1788
|
-
folderPath?: string,
|
|
1789
|
-
dbNameList?: string[],
|
|
1790
|
-
): Promise<void> {
|
|
1737
|
+
async moveDatabasesAndAddSuffix(folderPath?: string, dbNameList?: string[]): Promise<void> {
|
|
1791
1738
|
const path: string = folderPath ? folderPath : 'default';
|
|
1792
1739
|
const dbList: string[] = dbNameList ? dbNameList : [];
|
|
1793
1740
|
return this.sqlite.moveDatabasesAndAddSuffix({
|
|
@@ -1885,11 +1832,7 @@ export interface ISQLiteDBConnection {
|
|
|
1885
1832
|
* @returns Promise<capSQLiteChanges>
|
|
1886
1833
|
* @since 2.9.0 refactor
|
|
1887
1834
|
*/
|
|
1888
|
-
execute(
|
|
1889
|
-
statements: string,
|
|
1890
|
-
transaction?: boolean,
|
|
1891
|
-
isSQL92?: boolean,
|
|
1892
|
-
): Promise<capSQLiteChanges>;
|
|
1835
|
+
execute(statements: string, transaction?: boolean, isSQL92?: boolean): Promise<capSQLiteChanges>;
|
|
1893
1836
|
/**
|
|
1894
1837
|
* Execute SQLite DB Connection Query
|
|
1895
1838
|
* @param statement
|
|
@@ -1898,11 +1841,7 @@ export interface ISQLiteDBConnection {
|
|
|
1898
1841
|
* @returns Promise<Promise<DBSQLiteValues>
|
|
1899
1842
|
* @since 2.9.0 refactor
|
|
1900
1843
|
*/
|
|
1901
|
-
query(
|
|
1902
|
-
statement: string,
|
|
1903
|
-
values?: any[],
|
|
1904
|
-
isSQL92?: boolean,
|
|
1905
|
-
): Promise<DBSQLiteValues>;
|
|
1844
|
+
query(statement: string, values?: any[], isSQL92?: boolean): Promise<DBSQLiteValues>;
|
|
1906
1845
|
/**
|
|
1907
1846
|
* Execute SQLite DB Connection Raw Statement
|
|
1908
1847
|
* @param statement
|
|
@@ -2005,10 +1944,7 @@ export interface ISQLiteDBConnection {
|
|
|
2005
1944
|
* @returns Promise<capSQLiteChanges> since 5.0.7
|
|
2006
1945
|
* @since 3.4.0
|
|
2007
1946
|
*/
|
|
2008
|
-
executeTransaction(
|
|
2009
|
-
txn: capTask[],
|
|
2010
|
-
isSQL92: boolean,
|
|
2011
|
-
): Promise<capSQLiteChanges>;
|
|
1947
|
+
executeTransaction(txn: capTask[], isSQL92: boolean): Promise<capSQLiteChanges>;
|
|
2012
1948
|
}
|
|
2013
1949
|
/**
|
|
2014
1950
|
* SQLiteDBConnection Class
|
|
@@ -2148,11 +2084,7 @@ export class SQLiteDBConnection implements ISQLiteDBConnection {
|
|
|
2148
2084
|
return Promise.reject(err);
|
|
2149
2085
|
}
|
|
2150
2086
|
}
|
|
2151
|
-
async execute(
|
|
2152
|
-
statements: string,
|
|
2153
|
-
transaction = true,
|
|
2154
|
-
isSQL92 = true,
|
|
2155
|
-
): Promise<capSQLiteChanges> {
|
|
2087
|
+
async execute(statements: string, transaction = true, isSQL92 = true): Promise<capSQLiteChanges> {
|
|
2156
2088
|
try {
|
|
2157
2089
|
if (!this.readonly) {
|
|
2158
2090
|
const res: any = await this.sqlite.execute({
|
|
@@ -2170,11 +2102,7 @@ export class SQLiteDBConnection implements ISQLiteDBConnection {
|
|
|
2170
2102
|
return Promise.reject(err);
|
|
2171
2103
|
}
|
|
2172
2104
|
}
|
|
2173
|
-
async query(
|
|
2174
|
-
statement: string,
|
|
2175
|
-
values?: any[],
|
|
2176
|
-
isSQL92 = true,
|
|
2177
|
-
): Promise<DBSQLiteValues> {
|
|
2105
|
+
async query(statement: string, values?: any[], isSQL92 = true): Promise<DBSQLiteValues> {
|
|
2178
2106
|
let res: any;
|
|
2179
2107
|
try {
|
|
2180
2108
|
if (values && values.length > 0) {
|
|
@@ -2358,8 +2286,7 @@ export class SQLiteDBConnection implements ISQLiteDBConnection {
|
|
|
2358
2286
|
readonly: this.readonly,
|
|
2359
2287
|
});
|
|
2360
2288
|
let retDate = '';
|
|
2361
|
-
if (res.syncDate > 0)
|
|
2362
|
-
retDate = new Date(res.syncDate * 1000).toISOString();
|
|
2289
|
+
if (res.syncDate > 0) retDate = new Date(res.syncDate * 1000).toISOString();
|
|
2363
2290
|
return Promise.resolve(retDate);
|
|
2364
2291
|
} catch (err) {
|
|
2365
2292
|
return Promise.reject(err);
|
|
@@ -2394,10 +2321,7 @@ export class SQLiteDBConnection implements ISQLiteDBConnection {
|
|
|
2394
2321
|
}
|
|
2395
2322
|
}
|
|
2396
2323
|
|
|
2397
|
-
async executeTransaction(
|
|
2398
|
-
txn: capTask[],
|
|
2399
|
-
isSQL92 = true,
|
|
2400
|
-
): Promise<capSQLiteChanges> {
|
|
2324
|
+
async executeTransaction(txn: capTask[], isSQL92 = true): Promise<capSQLiteChanges> {
|
|
2401
2325
|
let changes = 0;
|
|
2402
2326
|
let isActive = false;
|
|
2403
2327
|
if (!this.readonly) {
|
|
@@ -2408,19 +2332,15 @@ export class SQLiteDBConnection implements ISQLiteDBConnection {
|
|
|
2408
2332
|
database: this.dbName,
|
|
2409
2333
|
});
|
|
2410
2334
|
if (!isActive) {
|
|
2411
|
-
return Promise.reject(
|
|
2412
|
-
'After Begin Transaction, no transaction active',
|
|
2413
|
-
);
|
|
2335
|
+
return Promise.reject('After Begin Transaction, no transaction active');
|
|
2414
2336
|
}
|
|
2415
2337
|
try {
|
|
2416
2338
|
for (const task of txn) {
|
|
2417
|
-
if(typeof task !== 'object' || !('statement' in task)) {
|
|
2339
|
+
if (typeof task !== 'object' || !('statement' in task)) {
|
|
2418
2340
|
throw new Error('Error a task.statement must be provided');
|
|
2419
2341
|
}
|
|
2420
2342
|
if ('values' in task && task.values && task.values.length > 0) {
|
|
2421
|
-
const retMode = task.statement.toUpperCase().includes('RETURNING')
|
|
2422
|
-
? 'all'
|
|
2423
|
-
: 'no';
|
|
2343
|
+
const retMode = task.statement.toUpperCase().includes('RETURNING') ? 'all' : 'no';
|
|
2424
2344
|
const ret = await this.sqlite.run({
|
|
2425
2345
|
database: this.dbName,
|
|
2426
2346
|
statement: task.statement,
|
package/src/index.ts
CHANGED
|
@@ -2,14 +2,10 @@ import { registerPlugin } from '@capacitor/core';
|
|
|
2
2
|
|
|
3
3
|
import type { CapacitorSQLitePlugin } from './definitions';
|
|
4
4
|
|
|
5
|
-
const CapacitorSQLite = registerPlugin<CapacitorSQLitePlugin>(
|
|
6
|
-
'
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
electron: () =>
|
|
10
|
-
(window as any).CapacitorCustomPlatform.plugins.CapacitorSQLite,
|
|
11
|
-
},
|
|
12
|
-
);
|
|
5
|
+
const CapacitorSQLite = registerPlugin<CapacitorSQLitePlugin>('CapacitorSQLite', {
|
|
6
|
+
web: () => import('./web').then((m) => new m.CapacitorSQLiteWeb()),
|
|
7
|
+
electron: () => (window as any).CapacitorCustomPlatform.plugins.CapacitorSQLite,
|
|
8
|
+
});
|
|
13
9
|
|
|
14
10
|
export { CapacitorSQLite };
|
|
15
11
|
export * from './definitions';
|