@capawesome/capacitor-libsql 0.1.0 → 0.1.1-dev.1765885034
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/Package.swift +2 -2
- package/README.md +88 -3
- package/android/build.gradle +18 -13
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/libsql/LibsqlPlugin.java +3 -3
- package/dist/esm/definitions.d.ts +1 -1
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/Libsql.swift +15 -3
- package/package.json +10 -10
package/Package.swift
CHANGED
|
@@ -3,14 +3,14 @@ import PackageDescription
|
|
|
3
3
|
|
|
4
4
|
let package = Package(
|
|
5
5
|
name: "CapawesomeCapacitorLibsql",
|
|
6
|
-
platforms: [.iOS(.
|
|
6
|
+
platforms: [.iOS(.v15)],
|
|
7
7
|
products: [
|
|
8
8
|
.library(
|
|
9
9
|
name: "CapawesomeCapacitorLibsql",
|
|
10
10
|
targets: ["LibsqlPlugin"])
|
|
11
11
|
],
|
|
12
12
|
dependencies: [
|
|
13
|
-
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "
|
|
13
|
+
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.0"),
|
|
14
14
|
.package(url: "https://github.com/tursodatabase/libsql-swift", from: "0.1.1")
|
|
15
15
|
],
|
|
16
16
|
targets: [
|
package/README.md
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
# @capawesome/capacitor-libsql
|
|
2
2
|
|
|
3
|
-
Capacitor plugin for libSQL databases.
|
|
3
|
+
Capacitor plugin for [libSQL](https://docs.turso.tech/libsql) databases.[^1]
|
|
4
|
+
|
|
5
|
+
<div class="capawesome-z29o10a">
|
|
6
|
+
<a href="https://cloud.capawesome.io/" target="_blank">
|
|
7
|
+
<img alt="Deliver Live Updates to your Capacitor app with Capawesome Cloud" src="https://cloud.capawesome.io/assets/banners/cloud-build-and-deploy-capacitor-apps.png?t=1" />
|
|
8
|
+
</a>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
## Compatibility
|
|
12
|
+
|
|
13
|
+
| Plugin Version | Capacitor Version | Status |
|
|
14
|
+
| -------------- | ----------------- | -------------- |
|
|
15
|
+
| 0.2.x | >=8.x.x | Active support |
|
|
16
|
+
| 0.1.x | 7.x.x | Deprecated |
|
|
4
17
|
|
|
5
18
|
## Installation
|
|
6
19
|
|
|
@@ -9,13 +22,83 @@ npm install @capawesome/capacitor-libsql
|
|
|
9
22
|
npx cap sync
|
|
10
23
|
```
|
|
11
24
|
|
|
25
|
+
### Android
|
|
26
|
+
|
|
27
|
+
#### Variables
|
|
28
|
+
|
|
29
|
+
If needed, you can define the following project variable in your app's `variables.gradle` file to change the default version of the dependency:
|
|
30
|
+
|
|
31
|
+
- `$libsqlVersion` version of `tech.turso.libsql:libsql` (default: `0.1.2`)
|
|
32
|
+
|
|
33
|
+
This can be useful if you encounter dependency conflicts with other plugins in your project.
|
|
34
|
+
|
|
12
35
|
## Usage
|
|
13
36
|
|
|
14
37
|
```typescript
|
|
15
38
|
import { Libsql } from '@capawesome/capacitor-libsql';
|
|
16
39
|
|
|
17
|
-
const
|
|
18
|
-
await Libsql.
|
|
40
|
+
const connectToLocalDatabase = async () => {
|
|
41
|
+
const { connectionId } = await Libsql.connect({
|
|
42
|
+
path: 'database.db',
|
|
43
|
+
});
|
|
44
|
+
console.log('Connected to database with ID:', connectionId);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const connectToRemoteDatabase = async () => {
|
|
48
|
+
const { connectionId } = await Libsql.connect({
|
|
49
|
+
url: 'libsql://your-database-url.turso.io',
|
|
50
|
+
authToken: 'your-auth-token',
|
|
51
|
+
});
|
|
52
|
+
console.log('Connected to remote database with ID:', connectionId);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const query = async () => {
|
|
56
|
+
const result = await Libsql.query({
|
|
57
|
+
connectionId: 'my-connection-id',
|
|
58
|
+
statement: 'SELECT * FROM my_table',
|
|
59
|
+
});
|
|
60
|
+
console.log('Query result:', result.rows);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const execute = async () => {
|
|
64
|
+
await Libsql.execute({
|
|
65
|
+
connectionId: 'my-connection-id',
|
|
66
|
+
statement: 'INSERT INTO my_table (column1, column2) VALUES (?, ?)',
|
|
67
|
+
values: ['value1', 'value2'],
|
|
68
|
+
});
|
|
69
|
+
console.log('Insert executed successfully');
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const performTransaction = async () => {
|
|
73
|
+
const { transactionId } = await Libsql.beginTransaction({
|
|
74
|
+
connectionId: 'my-connection-id',
|
|
75
|
+
});
|
|
76
|
+
try {
|
|
77
|
+
await Libsql.execute({
|
|
78
|
+
connectionId: 'my-connection-id',
|
|
79
|
+
statement: 'UPDATE my_table SET column1 = ? WHERE column2 = ?',
|
|
80
|
+
values: ['new_value', 'value2'],
|
|
81
|
+
transactionId,
|
|
82
|
+
});
|
|
83
|
+
await Libsql.commitTransaction({
|
|
84
|
+
connectionId: 'my-connection-id',
|
|
85
|
+
transactionId,
|
|
86
|
+
});
|
|
87
|
+
console.log('Transaction committed successfully');
|
|
88
|
+
} catch (error) {
|
|
89
|
+
await Libsql.rollbackTransaction({
|
|
90
|
+
connectionId: 'my-connection-id',
|
|
91
|
+
transactionId,
|
|
92
|
+
});
|
|
93
|
+
console.error('Transaction rolled back due to error:', error);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const sync = async () => {
|
|
98
|
+
await Libsql.sync({
|
|
99
|
+
connectionId: 'my-connection-id',
|
|
100
|
+
});
|
|
101
|
+
console.log('Database synchronized successfully');
|
|
19
102
|
};
|
|
20
103
|
```
|
|
21
104
|
|
|
@@ -299,3 +382,5 @@ Only available on iOS.
|
|
|
299
382
|
<code>string | number | null</code>
|
|
300
383
|
|
|
301
384
|
</docgen-api>
|
|
385
|
+
|
|
386
|
+
[^1]: This project is not affiliated with, endorsed by, sponsored by, or approved by CHISELSTRIKE INC. or any of their affiliates or subsidiaries.
|
package/android/build.gradle
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
|
+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
|
2
|
+
|
|
1
3
|
ext {
|
|
2
4
|
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
|
|
3
|
-
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.
|
|
4
|
-
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.
|
|
5
|
-
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.
|
|
6
|
-
libsqlVersion = project.hasProperty('libsqlVersion') ? rootProject.ext.libsqlVersion : '0.1.
|
|
5
|
+
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.1'
|
|
6
|
+
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.3.0'
|
|
7
|
+
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.7.0'
|
|
8
|
+
libsqlVersion = project.hasProperty('libsqlVersion') ? rootProject.ext.libsqlVersion : '0.1.2'
|
|
7
9
|
}
|
|
8
10
|
|
|
9
11
|
buildscript {
|
|
10
|
-
ext.kotlin_version = project.hasProperty("kotlin_version") ? rootProject.ext.kotlin_version : '
|
|
12
|
+
ext.kotlin_version = project.hasProperty("kotlin_version") ? rootProject.ext.kotlin_version : '2.2.20'
|
|
11
13
|
repositories {
|
|
12
14
|
google()
|
|
13
15
|
mavenCentral()
|
|
14
16
|
}
|
|
15
17
|
dependencies {
|
|
16
|
-
classpath 'com.android.tools.build:gradle:8.
|
|
18
|
+
classpath 'com.android.tools.build:gradle:8.13.0'
|
|
17
19
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
18
20
|
}
|
|
19
21
|
}
|
|
@@ -22,11 +24,11 @@ apply plugin: 'com.android.library'
|
|
|
22
24
|
apply plugin: 'org.jetbrains.kotlin.android'
|
|
23
25
|
|
|
24
26
|
android {
|
|
25
|
-
namespace "io.capawesome.capacitorjs.plugins.libsql"
|
|
26
|
-
compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion :
|
|
27
|
+
namespace = "io.capawesome.capacitorjs.plugins.libsql"
|
|
28
|
+
compileSdk = project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 36
|
|
27
29
|
defaultConfig {
|
|
28
|
-
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion :
|
|
29
|
-
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion :
|
|
30
|
+
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 24
|
|
31
|
+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 36
|
|
30
32
|
versionCode 1
|
|
31
33
|
versionName "1.0"
|
|
32
34
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
@@ -38,14 +40,17 @@ android {
|
|
|
38
40
|
}
|
|
39
41
|
}
|
|
40
42
|
lintOptions {
|
|
41
|
-
abortOnError false
|
|
43
|
+
abortOnError = false
|
|
42
44
|
}
|
|
43
45
|
compileOptions {
|
|
44
46
|
sourceCompatibility JavaVersion.VERSION_21
|
|
45
47
|
targetCompatibility JavaVersion.VERSION_21
|
|
46
48
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
kotlin {
|
|
52
|
+
compilerOptions {
|
|
53
|
+
jvmTarget = JvmTarget.JVM_21
|
|
49
54
|
}
|
|
50
55
|
}
|
|
51
56
|
|
|
@@ -187,7 +187,7 @@ public class LibsqlPlugin extends Plugin {
|
|
|
187
187
|
|
|
188
188
|
@PluginMethod
|
|
189
189
|
public void sync(PluginCall call) {
|
|
190
|
-
|
|
190
|
+
rejectCallAsUnimplemented(call);
|
|
191
191
|
}
|
|
192
192
|
|
|
193
193
|
private void rejectCall(@NonNull PluginCall call, @NonNull Exception exception) {
|
|
@@ -199,8 +199,8 @@ public class LibsqlPlugin extends Plugin {
|
|
|
199
199
|
call.reject(message);
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
-
private void
|
|
203
|
-
call.unimplemented("Not
|
|
202
|
+
private void rejectCallAsUnimplemented(@NonNull PluginCall call) {
|
|
203
|
+
call.unimplemented("Not implemented on this platform.");
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
private void resolveCall(@NonNull PluginCall call) {
|
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Libsql = registerPlugin('Libsql', {\n web: () => import('./web').then(m => new m.LibsqlWeb()),\n});\nexport * from './definitions';\nexport { Libsql };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class LibsqlWeb extends WebPlugin {\n async beginTransaction(options) {\n console.log('beginTransaction', options);\n throw this.unimplemented('Not implemented on web.');\n }\n async commitTransaction(options) {\n console.log('commitTransaction', options);\n throw this.unimplemented('Not implemented on web.');\n }\n async connect(options) {\n console.log('connect', options);\n throw this.unimplemented('Not implemented on web.');\n }\n async execute(options) {\n console.log('execute', options);\n throw this.unimplemented('Not implemented on web.');\n }\n async executeBatch(options) {\n console.log('executeBatch', options);\n throw this.unimplemented('Not implemented on web.');\n }\n async query(options) {\n console.log('query', options);\n throw this.unimplemented('Not implemented on web.');\n }\n async rollbackTransaction(options) {\n console.log('rollbackTransaction', options);\n throw this.unimplemented('Not implemented on web.');\n }\n async sync(options) {\n console.log('sync', options);\n throw this.unimplemented('Not implemented on web.');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,MAAM,GAAGA,mBAAc,CAAC,QAAQ,EAAE;AACxC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;AAC3D,CAAC;;ACFM,MAAM,SAAS,SAASC,cAAS,CAAC;AACzC,IAAI,MAAM,gBAAgB,CAAC,OAAO,EAAE;AACpC,QAAQ,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,OAAO,CAAC;AAChD,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D;
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Libsql = registerPlugin('Libsql', {\n web: () => import('./web').then(m => new m.LibsqlWeb()),\n});\nexport * from './definitions';\nexport { Libsql };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class LibsqlWeb extends WebPlugin {\n async beginTransaction(options) {\n console.log('beginTransaction', options);\n throw this.unimplemented('Not implemented on web.');\n }\n async commitTransaction(options) {\n console.log('commitTransaction', options);\n throw this.unimplemented('Not implemented on web.');\n }\n async connect(options) {\n console.log('connect', options);\n throw this.unimplemented('Not implemented on web.');\n }\n async execute(options) {\n console.log('execute', options);\n throw this.unimplemented('Not implemented on web.');\n }\n async executeBatch(options) {\n console.log('executeBatch', options);\n throw this.unimplemented('Not implemented on web.');\n }\n async query(options) {\n console.log('query', options);\n throw this.unimplemented('Not implemented on web.');\n }\n async rollbackTransaction(options) {\n console.log('rollbackTransaction', options);\n throw this.unimplemented('Not implemented on web.');\n }\n async sync(options) {\n console.log('sync', options);\n throw this.unimplemented('Not implemented on web.');\n }\n}\n//# sourceMappingUR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CAAC;AACrC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,mBAAmB,CAAC,OAAO,EAAE;AACvC,QAAQ,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,OAAO,CAAC;AACnD,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;AACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;AACpC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ;;;;;;;;;"}
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Libsql = registerPlugin('Libsql', {\n web: () => import('./web').then(m => new m.LibsqlWeb()),\n});\nexport * from './definitions';\nexport { Libsql };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class LibsqlWeb extends WebPlugin {\n async beginTransaction(options) {\n console.log('beginTransaction', options);\n throw this.unimplemented('Not implemented on web.');\n }\n async commitTransaction(options) {\n console.log('commitTransaction', options);\n throw this.unimplemented('Not implemented on web.');\n }\n async connect(options) {\n console.log('connect', options);\n throw this.unimplemented('Not implemented on web.');\n }\n async execute(options) {\n console.log('execute', options);\n throw this.unimplemented('Not implemented on web.');\n }\n async executeBatch(options) {\n console.log('executeBatch', options);\n throw this.unimplemented('Not implemented on web.');\n }\n async query(options) {\n console.log('query', options);\n throw this.unimplemented('Not implemented on web.');\n }\n async rollbackTransaction(options) {\n console.log('rollbackTransaction', options);\n throw this.unimplemented('Not implemented on web.');\n }\n async sync(options) {\n console.log('sync', options);\n throw this.unimplemented('Not implemented on web.');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,MAAM,GAAGA,mBAAc,CAAC,QAAQ,EAAE;IACxC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;IAC3D,CAAC;;ICFM,MAAM,SAAS,SAASC,cAAS,CAAC;IACzC,IAAI,MAAM,gBAAgB,CAAC,OAAO,EAAE;IACpC,QAAQ,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,OAAO,CAAC;IAChD,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D;
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Libsql = registerPlugin('Libsql', {\n web: () => import('./web').then(m => new m.LibsqlWeb()),\n});\nexport * from './definitions';\nexport { Libsql };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class LibsqlWeb extends WebPlugin {\n async beginTransaction(options) {\n console.log('beginTransaction', options);\n throw this.unimplemented('Not implemented on web.');\n }\n async commitTransaction(options) {\n console.log('commitTransaction', options);\n throw this.unimplemented('Not implemented on web.');\n }\n async connect(options) {\n console.log('connect', options);\n throw this.unimplemented('Not implemented on web.');\n }\n async execute(options) {\n console.log('execute', options);\n throw this.unimplemented('Not implemented on web.');\n }\n async executeBatch(options) {\n console.log('executeBatch', options);\n throw this.unimplemented('Not implemented on web.');\n }\n async query(options) {\n console.log('query', options);\n throw this.unimplemented('Not implemented on web.');\n }\n async rollbackTransaction(options) {\n console.log('rollbackTransaction', options);\n throw this.unimplemented('Not implemented on web.');\n }\n async sync(options) {\n console.log('sync', options);\n throw this.unimplemented('Not implemented on web.');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,MAAM,GAAGA,mBAAc,CAAC,QAAQ,EAA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M,mBAAmB,CAAC,OAAO,EAAE;IACvC,QAAQ,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,OAAO,CAAC;IACnD,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;IACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IACpC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ;;;;;;;;;;;;;;;"}
|
package/ios/Plugin/Libsql.swift
CHANGED
|
@@ -54,7 +54,11 @@ import Libsql
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
if let values = options.values, !values.isEmpty {
|
|
57
|
-
|
|
57
|
+
guard let valueRepresentables = values as? [ValueRepresentable] else {
|
|
58
|
+
completion(LibsqlError.invalidValues)
|
|
59
|
+
return
|
|
60
|
+
}
|
|
61
|
+
try connection.execute(options.statement, valueRepresentables)
|
|
58
62
|
} else {
|
|
59
63
|
try connection.execute(options.statement)
|
|
60
64
|
}
|
|
@@ -76,7 +80,11 @@ import Libsql
|
|
|
76
80
|
let values = options.values?[safe: index]
|
|
77
81
|
|
|
78
82
|
if let values = values, !values.isEmpty {
|
|
79
|
-
|
|
83
|
+
guard let valueRepresentables = values as? [ValueRepresentable] else {
|
|
84
|
+
completion(LibsqlError.invalidValues)
|
|
85
|
+
return
|
|
86
|
+
}
|
|
87
|
+
try connection.execute(statement, valueRepresentables)
|
|
80
88
|
} else {
|
|
81
89
|
try connection.execute(statement)
|
|
82
90
|
}
|
|
@@ -113,7 +121,11 @@ import Libsql
|
|
|
113
121
|
}
|
|
114
122
|
|
|
115
123
|
if let values = options.values, !values.isEmpty {
|
|
116
|
-
|
|
124
|
+
guard let valueRepresentables = values as? [ValueRepresentable] else {
|
|
125
|
+
completion(nil, LibsqlError.invalidValues)
|
|
126
|
+
return
|
|
127
|
+
}
|
|
128
|
+
rows = try connection.query(options.statement, valueRepresentables)
|
|
117
129
|
} else {
|
|
118
130
|
rows = try connection.query(options.statement)
|
|
119
131
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capawesome/capacitor-libsql",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1-dev.1765885034",
|
|
4
4
|
"description": "Capacitor plugin for libSQL databases.",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -55,23 +55,23 @@
|
|
|
55
55
|
"prepublishOnly": "npm run build"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@capacitor/android": "
|
|
59
|
-
"@capacitor/cli": "
|
|
60
|
-
"@capacitor/core": "
|
|
61
|
-
"@capacitor/docgen": "0.3.
|
|
62
|
-
"@capacitor/ios": "
|
|
58
|
+
"@capacitor/android": "8.0.0",
|
|
59
|
+
"@capacitor/cli": "8.0.0",
|
|
60
|
+
"@capacitor/core": "8.0.0",
|
|
61
|
+
"@capacitor/docgen": "0.3.1",
|
|
62
|
+
"@capacitor/ios": "8.0.0",
|
|
63
63
|
"@ionic/eslint-config": "0.4.0",
|
|
64
64
|
"@ionic/swiftlint-config": "2.0.0",
|
|
65
65
|
"eslint": "8.57.0",
|
|
66
66
|
"prettier": "3.4.2",
|
|
67
67
|
"prettier-plugin-java": "2.6.7",
|
|
68
|
-
"rimraf": "6.
|
|
69
|
-
"rollup": "4.
|
|
68
|
+
"rimraf": "6.1.2",
|
|
69
|
+
"rollup": "4.53.3",
|
|
70
70
|
"swiftlint": "2.0.0",
|
|
71
|
-
"typescript": "
|
|
71
|
+
"typescript": "5.9.3"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
|
-
"@capacitor/core": ">=
|
|
74
|
+
"@capacitor/core": ">=8.0.0"
|
|
75
75
|
},
|
|
76
76
|
"swiftlint": "@ionic/swiftlint-config",
|
|
77
77
|
"eslintConfig": {
|