Skip to content

Commit 266820a

Browse files
authored
Update SQLite to a thin wrapper over capacitor-community/sqlite (#55)
* Implement new driver `@derme302/localforage-capacitorsqlitedriver`
1 parent 321f0a3 commit 266820a

8 files changed

Lines changed: 45 additions & 37 deletions

File tree

android/app/capacitor.build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ dependencies {
1414
implementation project(':capacitor-haptics')
1515
implementation project(':capacitor-keyboard')
1616
implementation project(':capacitor-status-bar')
17-
implementation project(':capacitor-sqlite-storage')
17+
implementation project(':capacitor-community-sqlite')
1818

1919
}
2020

android/capacitor.settings.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ project(':capacitor-keyboard').projectDir = new File('../node_modules/@capacitor
1717
include ':capacitor-status-bar'
1818
project(':capacitor-status-bar').projectDir = new File('../node_modules/@capacitor/status-bar/android')
1919

20-
include ':capacitor-sqlite-storage'
21-
project(':capacitor-sqlite-storage').projectDir = new File('../node_modules/capacitor-sqlite-storage/android')
20+
include ':capacitor-community-sqlite'
21+
project(':capacitor-community-sqlite').projectDir = new File('../node_modules/@capacitor-community/sqlite/android')

ios/App/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def capacitor_pods
1616
pod 'CapacitorHaptics', :path => '../../node_modules/@capacitor/haptics'
1717
pod 'CapacitorKeyboard', :path => '../../node_modules/@capacitor/keyboard'
1818
pod 'CapacitorStatusBar', :path => '../../node_modules/@capacitor/status-bar'
19-
pod 'CapacitorSqliteStorage', :path => '../../node_modules/capacitor-sqlite-storage'
19+
pod 'CapacitorCommunitySqlite', :path => '../../node_modules/@capacitor-community/sqlite'
2020
end
2121

2222
target 'App' do

ios/App/Podfile.lock

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,54 +5,69 @@ PODS:
55
- Capacitor
66
- CapacitorBrowser (7.0.1):
77
- Capacitor
8+
- CapacitorCommunitySqlite (7.0.0):
9+
- Capacitor
10+
- SQLCipher
11+
- ZIPFoundation
812
- CapacitorCordova (7.3.0)
913
- CapacitorHaptics (7.0.1):
1014
- Capacitor
1115
- CapacitorKeyboard (7.0.1):
1216
- Capacitor
13-
- CapacitorSqliteStorage (0.0.3):
14-
- Capacitor
1517
- CapacitorStatusBar (7.0.1):
1618
- Capacitor
19+
- SQLCipher (4.9.0):
20+
- SQLCipher/standard (= 4.9.0)
21+
- SQLCipher/common (4.9.0)
22+
- SQLCipher/standard (4.9.0):
23+
- SQLCipher/common
24+
- ZIPFoundation (0.9.19)
1725

1826
DEPENDENCIES:
1927
- "Capacitor (from `../../node_modules/@capacitor/ios`)"
2028
- "CapacitorApp (from `../../node_modules/@capacitor/app`)"
2129
- "CapacitorBrowser (from `../../node_modules/@capacitor/browser`)"
30+
- "CapacitorCommunitySqlite (from `../../node_modules/@capacitor-community/sqlite`)"
2231
- "CapacitorCordova (from `../../node_modules/@capacitor/ios`)"
2332
- "CapacitorHaptics (from `../../node_modules/@capacitor/haptics`)"
2433
- "CapacitorKeyboard (from `../../node_modules/@capacitor/keyboard`)"
25-
- CapacitorSqliteStorage (from `../../node_modules/capacitor-sqlite-storage`)
2634
- "CapacitorStatusBar (from `../../node_modules/@capacitor/status-bar`)"
2735

36+
SPEC REPOS:
37+
trunk:
38+
- SQLCipher
39+
- ZIPFoundation
40+
2841
EXTERNAL SOURCES:
2942
Capacitor:
3043
:path: "../../node_modules/@capacitor/ios"
3144
CapacitorApp:
3245
:path: "../../node_modules/@capacitor/app"
3346
CapacitorBrowser:
3447
:path: "../../node_modules/@capacitor/browser"
48+
CapacitorCommunitySqlite:
49+
:path: "../../node_modules/@capacitor-community/sqlite"
3550
CapacitorCordova:
3651
:path: "../../node_modules/@capacitor/ios"
3752
CapacitorHaptics:
3853
:path: "../../node_modules/@capacitor/haptics"
3954
CapacitorKeyboard:
4055
:path: "../../node_modules/@capacitor/keyboard"
41-
CapacitorSqliteStorage:
42-
:path: "../../node_modules/capacitor-sqlite-storage"
4356
CapacitorStatusBar:
4457
:path: "../../node_modules/@capacitor/status-bar"
4558

4659
SPEC CHECKSUMS:
4760
Capacitor: 8585c18a230122906e114ba5f6325ec65ee1371f
4861
CapacitorApp: febecbb9582cb353aed037e18ec765141f880fe9
4962
CapacitorBrowser: 6299776d496e968505464884d565992faa20444a
63+
CapacitorCommunitySqlite: b11e556cf5d149f9e0b6fbbb47959a6cd718c3d0
5064
CapacitorCordova: 2685f5c43675793b5f06dfd66b3b26268f003b97
5165
CapacitorHaptics: 1f1e17041f435d8ead9ff2a34edd592c6aa6a8d6
5266
CapacitorKeyboard: 09fd91dcde4f8a37313e7f11bde553ad1ed52036
53-
CapacitorSqliteStorage: 7722f09c29d4d994d16a1db66d6cdb449521138c
5467
CapacitorStatusBar: 6e7af040d8fc4dd655999819625cae9c2d74c36f
68+
SQLCipher: 31878d8ebd27e5c96db0b7cb695c96e9f8ad77da
69+
ZIPFoundation: b8c29ea7ae353b309bc810586181fd073cb3312c
5570

56-
PODFILE CHECKSUM: 6c2c6f6143679df0d0045483a1342e448bb923ce
71+
PODFILE CHECKSUM: 35cf255c7b0d226be99a527c81471ab76befcd86
5772

5873
COCOAPODS: 1.16.2

package-lock.json

Lines changed: 13 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@
3131
"@capacitor/ios": "^7.0.0",
3232
"@capacitor/keyboard": "^7.0.0",
3333
"@capacitor/status-bar": "^7.0.0",
34+
"@capacitor-community/sqlite": "^7.0.0",
35+
"@derme302/localforage-capacitorsqlitedriver": "^1.1.2",
3436
"@ionic/angular": "8.6.1",
3537
"@ionic/storage-angular": "^4.0.0",
36-
"capacitor-sqlite-storage": "^0.0.3",
3738
"ionicons": "^7.2.2",
38-
"localforage-cordovasqlitedriver": "^1.8.0",
3939
"rxjs": "7.8.2",
4040
"tslib": "2.8.1",
4141
"zone.js": "~0.14.6"

src/app/services/storage.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Injectable } from '@angular/core';
22
import { Storage } from '@ionic/storage-angular';
3-
import * as CordovaSQLiteDriver from 'localforage-cordovasqlitedriver';
3+
import { SQLiteDriver } from '@derme302/localforage-capacitorsqlitedriver';
44
import { BehaviorSubject } from 'rxjs';
55

66

@@ -17,7 +17,7 @@ export class StorageService {
1717
}
1818

1919
async init() {
20-
await this.storage.defineDriver(CordovaSQLiteDriver);
20+
await this.storage.defineDriver(new SQLiteDriver());
2121
const storage = await this.storage.create();
2222
this._storage = storage;
2323
this.isReady = true;

src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { environment } from './environments/environment';
99
import { Drivers } from '@ionic/storage';
1010
import { IonicStorageModule } from '@ionic/storage-angular';
1111

12-
import { SQLite } from 'capacitor-sqlite-storage';
12+
import { CAPACITOR_SQLITE_DRIVER } from '@derme302/localforage-capacitorsqlitedriver';
1313
import { PlatformService } from './app/services/platform.service';
1414
import { StorageService } from './app/services/storage.service';
1515
import { SourcesService } from './app/services/sources.service';
@@ -25,7 +25,7 @@ bootstrapApplication(AppComponent, {
2525
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
2626
provideIonicAngular(),
2727
importProvidersFrom(IonicStorageModule.forRoot({
28-
driverOrder: [SQLite, Drivers.IndexedDB, Drivers.LocalStorage]
28+
driverOrder: [CAPACITOR_SQLITE_DRIVER, Drivers.IndexedDB, Drivers.LocalStorage]
2929
})),
3030
provideRouter(routes),
3131
PlatformService,

0 commit comments

Comments
 (0)