@capacitor-community/sqlite 3.4.2 → 3.4.3-1
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 +9 -2
- package/android/src/main/java/com/getcapacitor/community/database/sqlite/SQLite/UtilsUpgrade.java +8 -4
- package/dist/esm/definitions.d.ts +3 -1
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +19 -11
- package/dist/esm/web.js +277 -473
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +251 -447
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +251 -447
- package/dist/plugin.js.map +1 -1
- package/electron/dist/plugin.js +489 -701
- package/electron/dist/plugin.js.map +1 -1
- package/ios/Plugin/Utils/UtilsUpgrade.swift +33 -12
- package/package.json +6 -6
package/dist/plugin.js
CHANGED
|
@@ -653,563 +653,340 @@ var capacitorCapacitorSQLite = (function (exports, core) {
|
|
|
653
653
|
class CapacitorSQLiteWeb extends core.WebPlugin {
|
|
654
654
|
constructor() {
|
|
655
655
|
super(...arguments);
|
|
656
|
-
this.
|
|
657
|
-
this.
|
|
656
|
+
this.jeepSqliteElement = null;
|
|
657
|
+
this.isWebStoreOpen = false;
|
|
658
658
|
}
|
|
659
659
|
async initWebStore() {
|
|
660
660
|
await customElements.whenDefined('jeep-sqlite');
|
|
661
|
-
this.
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
else {
|
|
674
|
-
return Promise.reject('InitWeb: this.sqliteEl is null');
|
|
675
|
-
}
|
|
661
|
+
this.jeepSqliteElement = document.querySelector('jeep-sqlite');
|
|
662
|
+
this.ensureJeepSqliteIsAvailable();
|
|
663
|
+
this.jeepSqliteElement.addEventListener('jeepSqliteImportProgress', (event) => {
|
|
664
|
+
this.notifyListeners('sqliteImportProgressEvent', event.detail);
|
|
665
|
+
});
|
|
666
|
+
this.jeepSqliteElement.addEventListener('jeepSqliteExportProgress', (event) => {
|
|
667
|
+
this.notifyListeners('sqliteExportProgressEvent', event.detail);
|
|
668
|
+
});
|
|
669
|
+
if (!this.isWebStoreOpen) {
|
|
670
|
+
this.isWebStoreOpen = await this.jeepSqliteElement.isStoreOpen();
|
|
671
|
+
}
|
|
672
|
+
return;
|
|
676
673
|
}
|
|
677
674
|
async saveToStore(options) {
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
}
|
|
684
|
-
catch (err) {
|
|
685
|
-
return Promise.reject(`${err}`);
|
|
686
|
-
}
|
|
687
|
-
}
|
|
688
|
-
else {
|
|
689
|
-
return Promise.reject(`Store "jeepSqliteStore" failed to open`);
|
|
690
|
-
}
|
|
675
|
+
this.ensureJeepSqliteIsAvailable();
|
|
676
|
+
this.ensureWebstoreIsOpen();
|
|
677
|
+
try {
|
|
678
|
+
await this.jeepSqliteElement.saveToStore(options);
|
|
679
|
+
return;
|
|
691
680
|
}
|
|
692
|
-
|
|
693
|
-
throw
|
|
681
|
+
catch (err) {
|
|
682
|
+
throw new Error(`${err}`);
|
|
694
683
|
}
|
|
695
684
|
}
|
|
696
685
|
async echo(options) {
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
}
|
|
701
|
-
else {
|
|
702
|
-
throw this.unimplemented('Not implemented on web.');
|
|
703
|
-
}
|
|
704
|
-
}
|
|
705
|
-
async isSecretStored() {
|
|
706
|
-
throw this.unimplemented('Not implemented on web.');
|
|
707
|
-
}
|
|
708
|
-
async setEncryptionSecret(options) {
|
|
709
|
-
console.log('setEncryptionSecret', options);
|
|
710
|
-
throw this.unimplemented('Not implemented on web.');
|
|
711
|
-
}
|
|
712
|
-
async changeEncryptionSecret(options) {
|
|
713
|
-
console.log('changeEncryptionSecret', options);
|
|
714
|
-
throw this.unimplemented('Not implemented on web.');
|
|
715
|
-
}
|
|
716
|
-
async getNCDatabasePath(options) {
|
|
717
|
-
console.log('getNCDatabasePath', options);
|
|
718
|
-
throw this.unimplemented('Not implemented on web.');
|
|
719
|
-
}
|
|
720
|
-
async createNCConnection(options) {
|
|
721
|
-
console.log('createNCConnection', options);
|
|
722
|
-
throw this.unimplemented('Not implemented on web.');
|
|
723
|
-
}
|
|
724
|
-
async closeNCConnection(options) {
|
|
725
|
-
console.log('closeNCConnection', options);
|
|
726
|
-
throw this.unimplemented('Not implemented on web.');
|
|
727
|
-
}
|
|
728
|
-
async isNCDatabase(options) {
|
|
729
|
-
console.log('isNCDatabase', options);
|
|
730
|
-
throw this.unimplemented('Not implemented on web.');
|
|
686
|
+
this.ensureJeepSqliteIsAvailable();
|
|
687
|
+
const echoResult = await this.jeepSqliteElement.echo(options);
|
|
688
|
+
return echoResult;
|
|
731
689
|
}
|
|
732
690
|
async createConnection(options) {
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
}
|
|
739
|
-
catch (err) {
|
|
740
|
-
return Promise.reject(`${err}`);
|
|
741
|
-
}
|
|
742
|
-
}
|
|
743
|
-
else {
|
|
744
|
-
return Promise.reject(`Store "jeepSqliteStore" failed to open`);
|
|
745
|
-
}
|
|
691
|
+
this.ensureJeepSqliteIsAvailable();
|
|
692
|
+
this.ensureWebstoreIsOpen();
|
|
693
|
+
try {
|
|
694
|
+
await this.jeepSqliteElement.createConnection(options);
|
|
695
|
+
return;
|
|
746
696
|
}
|
|
747
|
-
|
|
748
|
-
throw
|
|
697
|
+
catch (err) {
|
|
698
|
+
throw new Error(`${err}`);
|
|
749
699
|
}
|
|
750
700
|
}
|
|
751
701
|
async open(options) {
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
}
|
|
758
|
-
catch (err) {
|
|
759
|
-
return Promise.reject(`${err}`);
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
else {
|
|
763
|
-
return Promise.reject(`Store "jeepSqliteStore" failed to open`);
|
|
764
|
-
}
|
|
702
|
+
this.ensureJeepSqliteIsAvailable();
|
|
703
|
+
this.ensureWebstoreIsOpen();
|
|
704
|
+
try {
|
|
705
|
+
await this.jeepSqliteElement.open(options);
|
|
706
|
+
return;
|
|
765
707
|
}
|
|
766
|
-
|
|
767
|
-
throw
|
|
708
|
+
catch (err) {
|
|
709
|
+
throw new Error(`${err}`);
|
|
768
710
|
}
|
|
769
711
|
}
|
|
770
712
|
async closeConnection(options) {
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
}
|
|
777
|
-
catch (err) {
|
|
778
|
-
return Promise.reject(`${err}`);
|
|
779
|
-
}
|
|
780
|
-
}
|
|
781
|
-
else {
|
|
782
|
-
return Promise.reject(`Store "jeepSqliteStore" failed to open`);
|
|
783
|
-
}
|
|
713
|
+
this.ensureJeepSqliteIsAvailable();
|
|
714
|
+
this.ensureWebstoreIsOpen();
|
|
715
|
+
try {
|
|
716
|
+
await this.jeepSqliteElement.closeConnection(options);
|
|
717
|
+
return;
|
|
784
718
|
}
|
|
785
|
-
|
|
786
|
-
throw
|
|
719
|
+
catch (err) {
|
|
720
|
+
throw new Error(`${err}`);
|
|
787
721
|
}
|
|
788
722
|
}
|
|
789
|
-
async getUrl() {
|
|
790
|
-
throw this.unimplemented('Not implemented on web.');
|
|
791
|
-
}
|
|
792
723
|
async getVersion(options) {
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
}
|
|
799
|
-
catch (err) {
|
|
800
|
-
return Promise.reject(`${err}`);
|
|
801
|
-
}
|
|
802
|
-
}
|
|
803
|
-
else {
|
|
804
|
-
return Promise.reject(`Store "jeepSqliteStore" failed to open`);
|
|
805
|
-
}
|
|
724
|
+
this.ensureJeepSqliteIsAvailable();
|
|
725
|
+
this.ensureWebstoreIsOpen();
|
|
726
|
+
try {
|
|
727
|
+
const versionResult = await this.jeepSqliteElement.getVersion(options);
|
|
728
|
+
return versionResult;
|
|
806
729
|
}
|
|
807
|
-
|
|
808
|
-
throw
|
|
730
|
+
catch (err) {
|
|
731
|
+
throw new Error(`${err}`);
|
|
809
732
|
}
|
|
810
733
|
}
|
|
811
734
|
async checkConnectionsConsistency(options) {
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
}
|
|
817
|
-
catch (err) {
|
|
818
|
-
return Promise.reject(`${err}`);
|
|
819
|
-
}
|
|
735
|
+
this.ensureJeepSqliteIsAvailable();
|
|
736
|
+
try {
|
|
737
|
+
const consistencyResult = await this.jeepSqliteElement.checkConnectionsConsistency(options);
|
|
738
|
+
return consistencyResult;
|
|
820
739
|
}
|
|
821
|
-
|
|
822
|
-
throw
|
|
740
|
+
catch (err) {
|
|
741
|
+
throw new Error(`${err}`);
|
|
823
742
|
}
|
|
824
743
|
}
|
|
825
744
|
async close(options) {
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
}
|
|
832
|
-
catch (err) {
|
|
833
|
-
return Promise.reject(`${err}`);
|
|
834
|
-
}
|
|
835
|
-
}
|
|
836
|
-
else {
|
|
837
|
-
return Promise.reject(`Store "jeepSqliteStore" failed to open`);
|
|
838
|
-
}
|
|
745
|
+
this.ensureJeepSqliteIsAvailable();
|
|
746
|
+
this.ensureWebstoreIsOpen();
|
|
747
|
+
try {
|
|
748
|
+
await this.jeepSqliteElement.close(options);
|
|
749
|
+
return;
|
|
839
750
|
}
|
|
840
|
-
|
|
841
|
-
throw
|
|
751
|
+
catch (err) {
|
|
752
|
+
throw new Error(`${err}`);
|
|
842
753
|
}
|
|
843
754
|
}
|
|
844
755
|
async getTableList(options) {
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
}
|
|
851
|
-
catch (err) {
|
|
852
|
-
return Promise.reject(`${err}`);
|
|
853
|
-
}
|
|
854
|
-
}
|
|
855
|
-
else {
|
|
856
|
-
return Promise.reject(`Store "jeepSqliteStore" failed to open`);
|
|
857
|
-
}
|
|
756
|
+
this.ensureJeepSqliteIsAvailable();
|
|
757
|
+
this.ensureWebstoreIsOpen();
|
|
758
|
+
try {
|
|
759
|
+
const tableListResult = await this.jeepSqliteElement.getTableList(options);
|
|
760
|
+
return tableListResult;
|
|
858
761
|
}
|
|
859
|
-
|
|
860
|
-
throw
|
|
762
|
+
catch (err) {
|
|
763
|
+
throw new Error(`${err}`);
|
|
861
764
|
}
|
|
862
765
|
}
|
|
863
766
|
async execute(options) {
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
}
|
|
870
|
-
catch (err) {
|
|
871
|
-
return Promise.reject(`${err}`);
|
|
872
|
-
}
|
|
873
|
-
}
|
|
874
|
-
else {
|
|
875
|
-
return Promise.reject(`Store "jeepSqliteStore" failed to open`);
|
|
876
|
-
}
|
|
767
|
+
this.ensureJeepSqliteIsAvailable();
|
|
768
|
+
this.ensureWebstoreIsOpen();
|
|
769
|
+
try {
|
|
770
|
+
const executeResult = await this.jeepSqliteElement.execute(options);
|
|
771
|
+
return executeResult;
|
|
877
772
|
}
|
|
878
|
-
|
|
879
|
-
throw
|
|
773
|
+
catch (err) {
|
|
774
|
+
throw new Error(`${err}`);
|
|
880
775
|
}
|
|
881
776
|
}
|
|
882
777
|
async executeSet(options) {
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
}
|
|
889
|
-
catch (err) {
|
|
890
|
-
return Promise.reject(`${err}`);
|
|
891
|
-
}
|
|
892
|
-
}
|
|
893
|
-
else {
|
|
894
|
-
return Promise.reject(`Store "jeepSqliteStore" failed to open`);
|
|
895
|
-
}
|
|
778
|
+
this.ensureJeepSqliteIsAvailable();
|
|
779
|
+
this.ensureWebstoreIsOpen();
|
|
780
|
+
try {
|
|
781
|
+
const executeResult = await this.jeepSqliteElement.executeSet(options);
|
|
782
|
+
return executeResult;
|
|
896
783
|
}
|
|
897
|
-
|
|
898
|
-
throw
|
|
784
|
+
catch (err) {
|
|
785
|
+
throw new Error(`${err}`);
|
|
899
786
|
}
|
|
900
787
|
}
|
|
901
788
|
async run(options) {
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
}
|
|
908
|
-
catch (err) {
|
|
909
|
-
return Promise.reject(`${err}`);
|
|
910
|
-
}
|
|
911
|
-
}
|
|
912
|
-
else {
|
|
913
|
-
return Promise.reject(`Store "jeepSqliteStore" failed to open`);
|
|
914
|
-
}
|
|
789
|
+
this.ensureJeepSqliteIsAvailable();
|
|
790
|
+
this.ensureWebstoreIsOpen();
|
|
791
|
+
try {
|
|
792
|
+
const runResult = await this.jeepSqliteElement.run(options);
|
|
793
|
+
return runResult;
|
|
915
794
|
}
|
|
916
|
-
|
|
917
|
-
throw
|
|
795
|
+
catch (err) {
|
|
796
|
+
throw new Error(`${err}`);
|
|
918
797
|
}
|
|
919
798
|
}
|
|
920
799
|
async query(options) {
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
}
|
|
927
|
-
catch (err) {
|
|
928
|
-
return Promise.reject(`${err}`);
|
|
929
|
-
}
|
|
930
|
-
}
|
|
931
|
-
else {
|
|
932
|
-
return Promise.reject(`Store "jeepSqliteStore" failed to open`);
|
|
933
|
-
}
|
|
800
|
+
this.ensureJeepSqliteIsAvailable();
|
|
801
|
+
this.ensureWebstoreIsOpen();
|
|
802
|
+
try {
|
|
803
|
+
const queryResult = await this.jeepSqliteElement.query(options);
|
|
804
|
+
return queryResult;
|
|
934
805
|
}
|
|
935
|
-
|
|
936
|
-
throw
|
|
806
|
+
catch (err) {
|
|
807
|
+
throw new Error(`${err}`);
|
|
937
808
|
}
|
|
938
809
|
}
|
|
939
810
|
async isDBExists(options) {
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
}
|
|
946
|
-
catch (err) {
|
|
947
|
-
return Promise.reject(`${err}`);
|
|
948
|
-
}
|
|
949
|
-
}
|
|
950
|
-
else {
|
|
951
|
-
return Promise.reject(`Store "jeepSqliteStore" failed to open`);
|
|
952
|
-
}
|
|
811
|
+
this.ensureJeepSqliteIsAvailable();
|
|
812
|
+
this.ensureWebstoreIsOpen();
|
|
813
|
+
try {
|
|
814
|
+
const dbExistsResult = await this.jeepSqliteElement.isDBExists(options);
|
|
815
|
+
return dbExistsResult;
|
|
953
816
|
}
|
|
954
|
-
|
|
955
|
-
throw
|
|
817
|
+
catch (err) {
|
|
818
|
+
throw new Error(`${err}`);
|
|
956
819
|
}
|
|
957
820
|
}
|
|
958
821
|
async isDBOpen(options) {
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
}
|
|
965
|
-
catch (err) {
|
|
966
|
-
return Promise.reject(`${err}`);
|
|
967
|
-
}
|
|
968
|
-
}
|
|
969
|
-
else {
|
|
970
|
-
return Promise.reject(`Store "jeepSqliteStore" failed to open`);
|
|
971
|
-
}
|
|
822
|
+
this.ensureJeepSqliteIsAvailable();
|
|
823
|
+
this.ensureWebstoreIsOpen();
|
|
824
|
+
try {
|
|
825
|
+
const isDBOpenResult = await this.jeepSqliteElement.isDBOpen(options);
|
|
826
|
+
return isDBOpenResult;
|
|
972
827
|
}
|
|
973
|
-
|
|
974
|
-
throw
|
|
828
|
+
catch (err) {
|
|
829
|
+
throw new Error(`${err}`);
|
|
975
830
|
}
|
|
976
831
|
}
|
|
977
832
|
async isDatabase(options) {
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
const ret = await this.sqliteEl.isDatabase(options);
|
|
984
|
-
return Promise.resolve(ret);
|
|
985
|
-
}
|
|
986
|
-
catch (err) {
|
|
987
|
-
return Promise.reject(`${err}`);
|
|
988
|
-
}
|
|
989
|
-
}
|
|
990
|
-
else {
|
|
991
|
-
return Promise.reject(`Store "jeepSqliteStore" failed to open`);
|
|
992
|
-
}
|
|
833
|
+
this.ensureJeepSqliteIsAvailable();
|
|
834
|
+
this.ensureWebstoreIsOpen();
|
|
835
|
+
try {
|
|
836
|
+
const isDatabaseResult = await this.jeepSqliteElement.isDatabase(options);
|
|
837
|
+
return isDatabaseResult;
|
|
993
838
|
}
|
|
994
|
-
|
|
995
|
-
throw
|
|
839
|
+
catch (err) {
|
|
840
|
+
throw new Error(`${err}`);
|
|
996
841
|
}
|
|
997
842
|
}
|
|
998
843
|
async isTableExists(options) {
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
}
|
|
1005
|
-
catch (err) {
|
|
1006
|
-
return Promise.reject(`${err}`);
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1009
|
-
else {
|
|
1010
|
-
return Promise.reject(`Store "jeepSqliteStore" failed to open`);
|
|
1011
|
-
}
|
|
844
|
+
this.ensureJeepSqliteIsAvailable();
|
|
845
|
+
this.ensureWebstoreIsOpen();
|
|
846
|
+
try {
|
|
847
|
+
const tableExistsResult = await this.jeepSqliteElement.isTableExists(options);
|
|
848
|
+
return tableExistsResult;
|
|
1012
849
|
}
|
|
1013
|
-
|
|
1014
|
-
throw
|
|
850
|
+
catch (err) {
|
|
851
|
+
throw new Error(`${err}`);
|
|
1015
852
|
}
|
|
1016
853
|
}
|
|
1017
854
|
async deleteDatabase(options) {
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
}
|
|
1024
|
-
catch (err) {
|
|
1025
|
-
return Promise.reject(`${err}`);
|
|
1026
|
-
}
|
|
1027
|
-
}
|
|
1028
|
-
else {
|
|
1029
|
-
return Promise.reject(`Store "jeepSqliteStore" failed to open`);
|
|
1030
|
-
}
|
|
855
|
+
this.ensureJeepSqliteIsAvailable();
|
|
856
|
+
this.ensureWebstoreIsOpen();
|
|
857
|
+
try {
|
|
858
|
+
await this.jeepSqliteElement.deleteDatabase(options);
|
|
859
|
+
return;
|
|
1031
860
|
}
|
|
1032
|
-
|
|
1033
|
-
throw
|
|
861
|
+
catch (err) {
|
|
862
|
+
throw new Error(`${err}`);
|
|
1034
863
|
}
|
|
1035
864
|
}
|
|
1036
865
|
async isJsonValid(options) {
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
const ret = await this.sqliteEl.isJsonValid(options);
|
|
1043
|
-
return Promise.resolve(ret);
|
|
1044
|
-
}
|
|
1045
|
-
catch (err) {
|
|
1046
|
-
return Promise.reject(`${err}`);
|
|
1047
|
-
}
|
|
1048
|
-
}
|
|
1049
|
-
else {
|
|
1050
|
-
return Promise.reject(`Store "jeepSqliteStore" failed to open`);
|
|
1051
|
-
}
|
|
866
|
+
this.ensureJeepSqliteIsAvailable();
|
|
867
|
+
this.ensureWebstoreIsOpen();
|
|
868
|
+
try {
|
|
869
|
+
const isJsonValidResult = await this.jeepSqliteElement.isJsonValid(options);
|
|
870
|
+
return isJsonValidResult;
|
|
1052
871
|
}
|
|
1053
|
-
|
|
1054
|
-
throw
|
|
872
|
+
catch (err) {
|
|
873
|
+
throw new Error(`${err}`);
|
|
1055
874
|
}
|
|
1056
875
|
}
|
|
1057
876
|
async importFromJson(options) {
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
const ret = await this.sqliteEl.importFromJson(options);
|
|
1064
|
-
return Promise.resolve(ret);
|
|
1065
|
-
}
|
|
1066
|
-
catch (err) {
|
|
1067
|
-
return Promise.reject(`${err}`);
|
|
1068
|
-
}
|
|
1069
|
-
}
|
|
1070
|
-
else {
|
|
1071
|
-
return Promise.reject(`Store "jeepSqliteStore" failed to open`);
|
|
1072
|
-
}
|
|
877
|
+
this.ensureJeepSqliteIsAvailable();
|
|
878
|
+
this.ensureWebstoreIsOpen();
|
|
879
|
+
try {
|
|
880
|
+
const importFromJsonResult = await this.jeepSqliteElement.importFromJson(options);
|
|
881
|
+
return importFromJsonResult;
|
|
1073
882
|
}
|
|
1074
|
-
|
|
1075
|
-
throw
|
|
883
|
+
catch (err) {
|
|
884
|
+
throw new Error(`${err}`);
|
|
1076
885
|
}
|
|
1077
886
|
}
|
|
1078
887
|
async exportToJson(options) {
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
}
|
|
1085
|
-
catch (err) {
|
|
1086
|
-
return Promise.reject(`${err}`);
|
|
1087
|
-
}
|
|
1088
|
-
}
|
|
1089
|
-
else {
|
|
1090
|
-
return Promise.reject(`Store "jeepSqliteStore" failed to open`);
|
|
1091
|
-
}
|
|
888
|
+
this.ensureJeepSqliteIsAvailable();
|
|
889
|
+
this.ensureWebstoreIsOpen();
|
|
890
|
+
try {
|
|
891
|
+
const exportToJsonResult = await this.jeepSqliteElement.exportToJson(options);
|
|
892
|
+
return exportToJsonResult;
|
|
1092
893
|
}
|
|
1093
|
-
|
|
1094
|
-
throw
|
|
894
|
+
catch (err) {
|
|
895
|
+
throw new Error(`${err}`);
|
|
1095
896
|
}
|
|
1096
897
|
}
|
|
1097
898
|
async createSyncTable(options) {
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
}
|
|
1104
|
-
catch (err) {
|
|
1105
|
-
return Promise.reject(`${err}`);
|
|
1106
|
-
}
|
|
1107
|
-
}
|
|
1108
|
-
else {
|
|
1109
|
-
return Promise.reject(`Store "jeepSqliteStore" failed to open`);
|
|
1110
|
-
}
|
|
899
|
+
this.ensureJeepSqliteIsAvailable();
|
|
900
|
+
this.ensureWebstoreIsOpen();
|
|
901
|
+
try {
|
|
902
|
+
const createSyncTableResult = await this.jeepSqliteElement.createSyncTable(options);
|
|
903
|
+
return createSyncTableResult;
|
|
1111
904
|
}
|
|
1112
|
-
|
|
1113
|
-
throw
|
|
905
|
+
catch (err) {
|
|
906
|
+
throw new Error(`${err}`);
|
|
1114
907
|
}
|
|
1115
908
|
}
|
|
1116
909
|
async setSyncDate(options) {
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
}
|
|
1123
|
-
catch (err) {
|
|
1124
|
-
return Promise.reject(`${err}`);
|
|
1125
|
-
}
|
|
1126
|
-
}
|
|
1127
|
-
else {
|
|
1128
|
-
return Promise.reject(`Store "jeepSqliteStore" failed to open`);
|
|
1129
|
-
}
|
|
910
|
+
this.ensureJeepSqliteIsAvailable();
|
|
911
|
+
this.ensureWebstoreIsOpen();
|
|
912
|
+
try {
|
|
913
|
+
await this.jeepSqliteElement.setSyncDate(options);
|
|
914
|
+
return;
|
|
1130
915
|
}
|
|
1131
|
-
|
|
1132
|
-
throw
|
|
916
|
+
catch (err) {
|
|
917
|
+
throw new Error(`${err}`);
|
|
1133
918
|
}
|
|
1134
919
|
}
|
|
1135
920
|
async getSyncDate(options) {
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
}
|
|
1142
|
-
catch (err) {
|
|
1143
|
-
return Promise.reject(`${err}`);
|
|
1144
|
-
}
|
|
1145
|
-
}
|
|
1146
|
-
else {
|
|
1147
|
-
return Promise.reject(`Store "jeepSqliteStore" failed to open`);
|
|
1148
|
-
}
|
|
921
|
+
this.ensureJeepSqliteIsAvailable();
|
|
922
|
+
this.ensureWebstoreIsOpen();
|
|
923
|
+
try {
|
|
924
|
+
const getSyncDateResult = await this.jeepSqliteElement.getSyncDate(options);
|
|
925
|
+
return getSyncDateResult;
|
|
1149
926
|
}
|
|
1150
|
-
|
|
1151
|
-
throw
|
|
927
|
+
catch (err) {
|
|
928
|
+
throw new Error(`${err}`);
|
|
1152
929
|
}
|
|
1153
930
|
}
|
|
1154
931
|
async addUpgradeStatement(options) {
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
}
|
|
1161
|
-
catch (err) {
|
|
1162
|
-
return Promise.reject(`${err}`);
|
|
1163
|
-
}
|
|
1164
|
-
}
|
|
1165
|
-
else {
|
|
1166
|
-
return Promise.reject(`Store "jeepSqliteStore" failed to open`);
|
|
1167
|
-
}
|
|
932
|
+
this.ensureJeepSqliteIsAvailable();
|
|
933
|
+
this.ensureWebstoreIsOpen();
|
|
934
|
+
try {
|
|
935
|
+
await this.jeepSqliteElement.addUpgradeStatement(options);
|
|
936
|
+
return;
|
|
1168
937
|
}
|
|
1169
|
-
|
|
1170
|
-
throw
|
|
938
|
+
catch (err) {
|
|
939
|
+
throw new Error(`${err}`);
|
|
1171
940
|
}
|
|
1172
941
|
}
|
|
1173
942
|
async copyFromAssets(options) {
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
}
|
|
1180
|
-
catch (err) {
|
|
1181
|
-
return Promise.reject(`${err}`);
|
|
1182
|
-
}
|
|
1183
|
-
}
|
|
1184
|
-
else {
|
|
1185
|
-
return Promise.reject(`Store "jeepSqliteStore" failed to open`);
|
|
1186
|
-
}
|
|
943
|
+
this.ensureJeepSqliteIsAvailable();
|
|
944
|
+
this.ensureWebstoreIsOpen();
|
|
945
|
+
try {
|
|
946
|
+
await this.jeepSqliteElement.copyFromAssets(options);
|
|
947
|
+
return;
|
|
1187
948
|
}
|
|
1188
|
-
|
|
1189
|
-
throw
|
|
949
|
+
catch (err) {
|
|
950
|
+
throw new Error(`${err}`);
|
|
1190
951
|
}
|
|
1191
952
|
}
|
|
1192
953
|
async getDatabaseList() {
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
const ret = await this.sqliteEl.getDatabaseList();
|
|
1199
|
-
return Promise.resolve(ret);
|
|
1200
|
-
}
|
|
1201
|
-
catch (err) {
|
|
1202
|
-
return Promise.reject(`${err}`);
|
|
1203
|
-
}
|
|
1204
|
-
}
|
|
1205
|
-
else {
|
|
1206
|
-
return Promise.reject(`Store "jeepSqliteStore" failed to open`);
|
|
1207
|
-
}
|
|
954
|
+
this.ensureJeepSqliteIsAvailable();
|
|
955
|
+
this.ensureWebstoreIsOpen();
|
|
956
|
+
try {
|
|
957
|
+
const databaseListResult = await this.jeepSqliteElement.getDatabaseList();
|
|
958
|
+
return databaseListResult;
|
|
1208
959
|
}
|
|
1209
|
-
|
|
1210
|
-
throw
|
|
960
|
+
catch (err) {
|
|
961
|
+
throw new Error(`${err}`);
|
|
1211
962
|
}
|
|
1212
963
|
}
|
|
964
|
+
/**
|
|
965
|
+
* Checks if the `jeep-sqlite` element is present in the DOM.
|
|
966
|
+
* If it's not in the DOM, this method throws an Error.
|
|
967
|
+
*
|
|
968
|
+
* Attention: This will always fail, if the `intWebStore()` method wasn't called before.
|
|
969
|
+
*/
|
|
970
|
+
ensureJeepSqliteIsAvailable() {
|
|
971
|
+
if (this.jeepSqliteElement === null) {
|
|
972
|
+
throw new Error(`The jeep-sqlite element is not present in the DOM! Please check the @capacitor-community/sqlite documentation for instructions regarding the web platform.`);
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
ensureWebstoreIsOpen() {
|
|
976
|
+
if (!this.isWebStoreOpen) {
|
|
977
|
+
/**
|
|
978
|
+
* if (!this.isWebStoreOpen)
|
|
979
|
+
this.isWebStoreOpen = await this.jeepSqliteElement.isStoreOpen();
|
|
980
|
+
*/
|
|
981
|
+
throw new Error('WebStore is not open yet. You have to call "initWebStore()" first.');
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
////////////////////////////////////
|
|
985
|
+
////// UNIMPLEMENTED METHODS
|
|
986
|
+
////////////////////////////////////
|
|
987
|
+
async getUrl() {
|
|
988
|
+
throw this.unimplemented('Not implemented on web.');
|
|
989
|
+
}
|
|
1213
990
|
async getMigratableDbList(options) {
|
|
1214
991
|
console.log('getMigratableDbList', options);
|
|
1215
992
|
throw this.unimplemented('Not implemented on web.');
|
|
@@ -1222,6 +999,33 @@ var capacitorCapacitorSQLite = (function (exports, core) {
|
|
|
1222
999
|
console.log('deleteOldDatabases', options);
|
|
1223
1000
|
throw this.unimplemented('Not implemented on web.');
|
|
1224
1001
|
}
|
|
1002
|
+
async isSecretStored() {
|
|
1003
|
+
throw this.unimplemented('Not implemented on web.');
|
|
1004
|
+
}
|
|
1005
|
+
async setEncryptionSecret(options) {
|
|
1006
|
+
console.log('setEncryptionSecret', options);
|
|
1007
|
+
throw this.unimplemented('Not implemented on web.');
|
|
1008
|
+
}
|
|
1009
|
+
async changeEncryptionSecret(options) {
|
|
1010
|
+
console.log('changeEncryptionSecret', options);
|
|
1011
|
+
throw this.unimplemented('Not implemented on web.');
|
|
1012
|
+
}
|
|
1013
|
+
async getNCDatabasePath(options) {
|
|
1014
|
+
console.log('getNCDatabasePath', options);
|
|
1015
|
+
throw this.unimplemented('Not implemented on web.');
|
|
1016
|
+
}
|
|
1017
|
+
async createNCConnection(options) {
|
|
1018
|
+
console.log('createNCConnection', options);
|
|
1019
|
+
throw this.unimplemented('Not implemented on web.');
|
|
1020
|
+
}
|
|
1021
|
+
async closeNCConnection(options) {
|
|
1022
|
+
console.log('closeNCConnection', options);
|
|
1023
|
+
throw this.unimplemented('Not implemented on web.');
|
|
1024
|
+
}
|
|
1025
|
+
async isNCDatabase(options) {
|
|
1026
|
+
console.log('isNCDatabase', options);
|
|
1027
|
+
throw this.unimplemented('Not implemented on web.');
|
|
1028
|
+
}
|
|
1225
1029
|
}
|
|
1226
1030
|
|
|
1227
1031
|
var web = /*#__PURE__*/Object.freeze({
|