@capacitor-community/sqlite 3.5.2 → 4.0.0-0
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/android/build.gradle +11 -11
- package/android/src/main/java/com/getcapacitor/community/database/sqlite/SQLite/Database.java +1 -1
- package/android/src/main/java/com/getcapacitor/community/database/sqlite/SQLite/UtilsMigrate.java +5 -3
- package/ios/Plugin/Utils/UtilsFile.swift +16 -0
- package/package.json +8 -8
|
@@ -11,7 +11,7 @@ Pod::Spec.new do |s|
|
|
|
11
11
|
s.author = package['author']
|
|
12
12
|
s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
|
|
13
13
|
s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
|
|
14
|
-
s.ios.deployment_target = '
|
|
14
|
+
s.ios.deployment_target = '13.0'
|
|
15
15
|
s.dependency 'Capacitor'
|
|
16
16
|
s.dependency 'SQLCipher'
|
|
17
17
|
s.dependency 'ZIPFoundation'
|
package/android/build.gradle
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
ext {
|
|
2
|
-
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.
|
|
3
|
-
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.
|
|
4
|
-
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.
|
|
5
|
-
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.
|
|
2
|
+
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
|
|
3
|
+
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.4.2'
|
|
4
|
+
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.3'
|
|
5
|
+
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.4.0'
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
buildscript {
|
|
@@ -11,17 +11,17 @@ buildscript {
|
|
|
11
11
|
mavenCentral()
|
|
12
12
|
}
|
|
13
13
|
dependencies {
|
|
14
|
-
classpath 'com.android.tools.build:gradle:
|
|
14
|
+
classpath 'com.android.tools.build:gradle:7.2.1'
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
apply plugin: 'com.android.library'
|
|
19
19
|
|
|
20
20
|
android {
|
|
21
|
-
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion :
|
|
21
|
+
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 32
|
|
22
22
|
defaultConfig {
|
|
23
|
-
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion :
|
|
24
|
-
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion :
|
|
23
|
+
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
|
|
24
|
+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 32
|
|
25
25
|
versionCode 1
|
|
26
26
|
versionName "1.0"
|
|
27
27
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
@@ -36,14 +36,14 @@ android {
|
|
|
36
36
|
abortOnError false
|
|
37
37
|
}
|
|
38
38
|
compileOptions {
|
|
39
|
-
sourceCompatibility JavaVersion.
|
|
40
|
-
targetCompatibility JavaVersion.
|
|
39
|
+
sourceCompatibility JavaVersion.VERSION_11
|
|
40
|
+
targetCompatibility JavaVersion.VERSION_11
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
repositories {
|
|
45
45
|
google()
|
|
46
|
-
|
|
46
|
+
|
|
47
47
|
mavenCentral()
|
|
48
48
|
}
|
|
49
49
|
|
package/android/src/main/java/com/getcapacitor/community/database/sqlite/SQLite/Database.java
CHANGED
|
@@ -331,7 +331,7 @@ public class Database {
|
|
|
331
331
|
for (String cmd : statements) {
|
|
332
332
|
if (!cmd.endsWith(";")) cmd += ";";
|
|
333
333
|
String nCmd = cmd;
|
|
334
|
-
String trimCmd = nCmd.trim().substring(0, 11).toUpperCase();
|
|
334
|
+
String trimCmd = nCmd.trim().substring(0, Math.min(nCmd.trim().length(), 11)).toUpperCase();
|
|
335
335
|
if (trimCmd.equals("DELETE FROM") && nCmd.toLowerCase().contains("WHERE".toLowerCase())) {
|
|
336
336
|
String whereStmt = nCmd.trim();
|
|
337
337
|
nCmd = deleteSQL(this, whereStmt, new ArrayList<Object>());
|
package/android/src/main/java/com/getcapacitor/community/database/sqlite/SQLite/UtilsMigrate.java
CHANGED
|
@@ -74,7 +74,11 @@ public class UtilsMigrate {
|
|
|
74
74
|
public String getFolder(Context context, String folderPath) throws Exception {
|
|
75
75
|
String pathFiles = context.getFilesDir().getAbsolutePath();
|
|
76
76
|
String pathDB = new File(context.getFilesDir().getParentFile(), "databases").getAbsolutePath();
|
|
77
|
-
if (
|
|
77
|
+
if (folderPath.equals("default")) {
|
|
78
|
+
pathFiles = pathDB;
|
|
79
|
+
} else if (folderPath.equalsIgnoreCase("cache")) {
|
|
80
|
+
pathFiles = context.getCacheDir().getAbsolutePath();
|
|
81
|
+
} else {
|
|
78
82
|
String[] arr = folderPath.split("/", 2);
|
|
79
83
|
if (arr.length == 2) {
|
|
80
84
|
if (arr[0].equals("files")) {
|
|
@@ -85,8 +89,6 @@ public class UtilsMigrate {
|
|
|
85
89
|
throw new Exception("Folder " + folderPath + " not allowed");
|
|
86
90
|
}
|
|
87
91
|
}
|
|
88
|
-
} else {
|
|
89
|
-
pathFiles = pathDB;
|
|
90
92
|
}
|
|
91
93
|
return pathFiles;
|
|
92
94
|
}
|
|
@@ -20,6 +20,7 @@ enum UtilsFileError: Error {
|
|
|
20
20
|
case getDatabasesURLFailed
|
|
21
21
|
case getApplicationPathFailed
|
|
22
22
|
case getApplicationURLFailed
|
|
23
|
+
case getCacheURLFailed
|
|
23
24
|
case getLibraryPathFailed
|
|
24
25
|
case getLibraryURLFailed
|
|
25
26
|
case getFileListFailed
|
|
@@ -148,6 +149,8 @@ class UtilsFile {
|
|
|
148
149
|
dbPathURL = try UtilsFile.getApplicationURL().absoluteURL
|
|
149
150
|
} else if first[0] == "Library" {
|
|
150
151
|
dbPathURL = try UtilsFile.getLibraryURL().absoluteURL
|
|
152
|
+
} else if first[0].caseInsensitiveCompare("cache") == .orderedSame {
|
|
153
|
+
dbPathURL = try UtilsFile.getCacheURL().absoluteURL
|
|
151
154
|
} else if first[0] == "Documents" || first[0] == "default" {
|
|
152
155
|
dbPathURL = databaseURL
|
|
153
156
|
} else {
|
|
@@ -238,6 +241,19 @@ class UtilsFile {
|
|
|
238
241
|
throw UtilsFileError.getApplicationPathFailed
|
|
239
242
|
}
|
|
240
243
|
}
|
|
244
|
+
|
|
245
|
+
// MARK: - getCacheURL
|
|
246
|
+
|
|
247
|
+
class func getCacheURL() throws -> URL {
|
|
248
|
+
if let path: String = NSSearchPathForDirectoriesInDomains(
|
|
249
|
+
.cachesDirectory, .userDomainMask, true
|
|
250
|
+
).first {
|
|
251
|
+
return NSURL(fileURLWithPath: path) as URL
|
|
252
|
+
} else {
|
|
253
|
+
print("Error: getCacheURL did not find the cache folder")
|
|
254
|
+
throw UtilsFileError.getCacheURLFailed
|
|
255
|
+
}
|
|
256
|
+
}
|
|
241
257
|
|
|
242
258
|
// MARK: - getLibraryURL
|
|
243
259
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capacitor-community/sqlite",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-0",
|
|
4
4
|
"description": "Community plugin for native & electron SQLite databases",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -55,10 +55,10 @@
|
|
|
55
55
|
"prepublishOnly": "npm run build && npm run build-electron && npm run docgen"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@capacitor/android": "^
|
|
59
|
-
"@capacitor/core": "^
|
|
58
|
+
"@capacitor/android": "^4.0.0",
|
|
59
|
+
"@capacitor/core": "^4.0.0",
|
|
60
60
|
"@capacitor/docgen": "^0.0.17",
|
|
61
|
-
"@capacitor/ios": "^
|
|
61
|
+
"@capacitor/ios": "^4.0.0",
|
|
62
62
|
"@ionic/eslint-config": "^0.3.0",
|
|
63
63
|
"@ionic/prettier-config": "^1.0.1",
|
|
64
64
|
"@ionic/swiftlint-config": "^1.1.2",
|
|
@@ -66,15 +66,15 @@
|
|
|
66
66
|
"@rollup/plugin-node-resolve": "^13.0.4",
|
|
67
67
|
"electron": "^15.5.5",
|
|
68
68
|
"eslint": "^7.11.0",
|
|
69
|
-
"prettier": "~2.
|
|
70
|
-
"prettier-plugin-java": "~1.0.
|
|
69
|
+
"prettier": "~2.3.0",
|
|
70
|
+
"prettier-plugin-java": "~1.0.2",
|
|
71
71
|
"rimraf": "^3.0.2",
|
|
72
72
|
"rollup": "^2.32.0",
|
|
73
73
|
"swiftlint": "^1.0.1",
|
|
74
|
-
"typescript": "~4.
|
|
74
|
+
"typescript": "~4.1.5"
|
|
75
75
|
},
|
|
76
76
|
"peerDependencies": {
|
|
77
|
-
"@capacitor/core": "^
|
|
77
|
+
"@capacitor/core": "^4.0.0"
|
|
78
78
|
},
|
|
79
79
|
"prettier": "@ionic/prettier-config",
|
|
80
80
|
"swiftlint": "@ionic/swiftlint-config",
|