@capawesome/capacitor-libsql 0.2.1 → 0.2.3

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 CHANGED
@@ -21,10 +21,6 @@ let package = Package(
21
21
  .product(name: "Cordova", package: "capacitor-swift-pm"),
22
22
  .product(name: "Libsql", package: "libsql-swift")
23
23
  ],
24
- path: "ios/Plugin"),
25
- .testTarget(
26
- name: "LibsqlPluginTests",
27
- dependencies: ["LibsqlPlugin"],
28
- path: "ios/PluginTests")
24
+ path: "ios/Plugin")
29
25
  ]
30
26
  )
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @capawesome/capacitor-libsql
1
+ # Capacitor libSQL Plugin
2
2
 
3
3
  Capacitor plugin for [libSQL](https://docs.turso.tech/libsql) databases.[^1]
4
4
 
@@ -8,6 +8,15 @@ Capacitor plugin for [libSQL](https://docs.turso.tech/libsql) databases.[^1]
8
8
  </a>
9
9
  </div>
10
10
 
11
+ ## Use Cases
12
+
13
+ The libSQL plugin is typically used whenever an app needs a SQL database, for example:
14
+
15
+ - **Offline-first apps**: Store data in a local database file on the device and synchronize it with a remote server using the `sync(...)` method.
16
+ - **Remote databases**: Connect directly to a remote libSQL database, such as one hosted on Turso, using a URL and authentication token.
17
+ - **Structured local storage**: Create tables and insert, update, delete, and query data with SQL statements and bound values.
18
+ - **Atomic operations**: Group multiple statements into a transaction that can be committed or rolled back as a whole.
19
+
11
20
  ## Compatibility
12
21
 
13
22
  | Plugin Version | Capacitor Version | Status |
@@ -17,6 +26,21 @@ Capacitor plugin for [libSQL](https://docs.turso.tech/libsql) databases.[^1]
17
26
 
18
27
  ## Installation
19
28
 
29
+ You can use our **AI-Assisted Setup** to install the plugin.
30
+ Add the [Capawesome Skills](https://github.com/capawesome-team/skills) to your AI tool using the following command:
31
+
32
+ ```bash
33
+ npx skills add capawesome-team/skills --skill capacitor-plugins
34
+ ```
35
+
36
+ Then use the following prompt:
37
+
38
+ ```
39
+ Use the `capacitor-plugins` skill from `capawesome-team/skills` to install the `@capawesome/capacitor-libsql` plugin in my project.
40
+ ```
41
+
42
+ If you prefer **Manual Setup**, install the plugin by running the following commands and follow the platform-specific instructions below:
43
+
20
44
  ```bash
21
45
  npm install @capawesome/capacitor-libsql
22
46
  npx cap sync
@@ -34,6 +58,12 @@ This can be useful if you encounter dependency conflicts with other plugins in y
34
58
 
35
59
  ## Usage
36
60
 
61
+ The following examples show how to connect to local and remote databases, query data, execute insert, update, and delete statements, run statements inside a transaction, and synchronize with a remote server.
62
+
63
+ ### Connect to a local database
64
+
65
+ Connect to a local database file on the device. If no file exists at the specified path, a new file is created. If neither a path nor a URL is provided, the plugin creates a new in-memory database. This method must be called before any other methods that interact with the database:
66
+
37
67
  ```typescript
38
68
  import { Libsql } from '@capawesome/capacitor-libsql';
39
69
 
@@ -43,6 +73,14 @@ const connectToLocalDatabase = async () => {
43
73
  });
44
74
  console.log('Connected to database with ID:', connectionId);
45
75
  };
76
+ ```
77
+
78
+ ### Connect to a remote database
79
+
80
+ Connect to a remote libSQL database using its URL and an authentication token:
81
+
82
+ ```typescript
83
+ import { Libsql } from '@capawesome/capacitor-libsql';
46
84
 
47
85
  const connectToRemoteDatabase = async () => {
48
86
  const { connectionId } = await Libsql.connect({
@@ -51,6 +89,14 @@ const connectToRemoteDatabase = async () => {
51
89
  });
52
90
  console.log('Connected to remote database with ID:', connectionId);
53
91
  };
92
+ ```
93
+
94
+ ### Query data
95
+
96
+ Execute a `SELECT` statement and retrieve the result set:
97
+
98
+ ```typescript
99
+ import { Libsql } from '@capawesome/capacitor-libsql';
54
100
 
55
101
  const query = async () => {
56
102
  const result = await Libsql.query({
@@ -59,6 +105,14 @@ const query = async () => {
59
105
  });
60
106
  console.log('Query result:', result.rows);
61
107
  };
108
+ ```
109
+
110
+ ### Insert, update, and delete data
111
+
112
+ Execute any SQL statement, including `INSERT`, `UPDATE`, `DELETE`, and `CREATE TABLE`, optionally with bound values:
113
+
114
+ ```typescript
115
+ import { Libsql } from '@capawesome/capacitor-libsql';
62
116
 
63
117
  const execute = async () => {
64
118
  await Libsql.execute({
@@ -68,6 +122,14 @@ const execute = async () => {
68
122
  });
69
123
  console.log('Insert executed successfully');
70
124
  };
125
+ ```
126
+
127
+ ### Run multiple statements in a transaction
128
+
129
+ Begin a transaction, execute statements as part of it, and either commit or roll back all changes. Transactions are only available on Android:
130
+
131
+ ```typescript
132
+ import { Libsql } from '@capawesome/capacitor-libsql';
71
133
 
72
134
  const performTransaction = async () => {
73
135
  const { transactionId } = await Libsql.beginTransaction({
@@ -93,6 +155,14 @@ const performTransaction = async () => {
93
155
  console.error('Transaction rolled back due to error:', error);
94
156
  }
95
157
  };
158
+ ```
159
+
160
+ ### Synchronize with a remote server
161
+
162
+ Synchronize the database with the remote server:
163
+
164
+ ```typescript
165
+ import { Libsql } from '@capawesome/capacitor-libsql';
96
166
 
97
167
  const sync = async () => {
98
168
  await Libsql.sync({
@@ -191,7 +261,7 @@ execute(options: ExecuteOptions) => Promise<void>
191
261
 
192
262
  Execute a single SQL statement on the specified database connection.
193
263
 
194
- This method can be used to execute any SQL statement, including
264
+ This method can be used to execute any SQL statement, including
195
265
  `INSERT`, `UPDATE`, `DELETE`, and `CREATE TABLE`.
196
266
 
197
267
  | Param | Type |
@@ -230,7 +300,7 @@ query(options: QueryOptions) => Promise<QueryResult>
230
300
 
231
301
  Query the database and return the result set.
232
302
 
233
- This method can be used to execute `SELECT` statements
303
+ This method can be used to execute `SELECT` statements
234
304
  and retrieve the result set.
235
305
 
236
306
  | Param | Type |
@@ -385,4 +455,39 @@ Available on iOS and Android.
385
455
 
386
456
  </docgen-api>
387
457
 
458
+ ## FAQ
459
+
460
+ ### Can I use this plugin with Turso?
461
+
462
+ Yes, you can connect to a remote libSQL database hosted on [Turso](https://docs.turso.tech/libsql) by passing the database URL and an authentication token to the `connect(...)` method, as shown in the [usage example](#connect-to-a-remote-database) above.
463
+
464
+ ### Do I need a remote database to use this plugin?
465
+
466
+ No, the plugin also works with purely local databases. If you pass a `path` to the `connect(...)` method, the plugin uses a database file on the device and creates it if it does not exist. If you provide neither a path nor a URL, the plugin creates a new in-memory database.
467
+
468
+ ### Are transactions supported?
469
+
470
+ Yes, you can use the `beginTransaction(...)`, `commitTransaction(...)` and `rollbackTransaction(...)` methods to group multiple statements into a transaction. Note that transactions are only available on Android.
471
+
472
+ ### What is the difference between the `query` and `execute` methods?
473
+
474
+ The `query(...)` method is used to execute `SELECT` statements and retrieve the result set. The `execute(...)` method is used for any other SQL statement, including `INSERT`, `UPDATE`, `DELETE`, and `CREATE TABLE`, and does not return a result set. Both methods support binding values to the statement.
475
+
476
+ ### How do I keep a local database in sync with a remote server?
477
+
478
+ Call the `sync(...)` method with the ID of the connection you want to synchronize. This synchronizes the database with the remote server and is available on Android and iOS.
479
+
480
+ ### Can I use this plugin with Ionic, React, Vue or Angular?
481
+
482
+ Yes, the plugin is framework-agnostic. It works in any Capacitor app regardless of the web framework, including Ionic with Angular, React, or Vue, as well as plain JavaScript projects.
483
+
484
+ ## Related Plugins
485
+
486
+ - [Secure Preferences](https://capawesome.io/docs/sdks/capacitor/secure-preferences/): Securely store key/value pairs such as passwords or tokens.
487
+ - [SQLite](https://capawesome.io/docs/sdks/capacitor/sqlite/): Access SQLite databases with support for encryption, transactions, and schema migrations.
488
+
489
+ ## Newsletter
490
+
491
+ Stay up to date with the latest news and updates about the Capawesome, Capacitor, and Ionic ecosystem by subscribing to our [Capawesome Newsletter](https://cloud.capawesome.io/newsletter/).
492
+
388
493
  [^1]: This project is not affiliated with, endorsed by, sponsored by, or approved by CHISELSTRIKE INC. or any of their affiliates or subsidiaries.
@@ -36,7 +36,7 @@ android {
36
36
  buildTypes {
37
37
  release {
38
38
  minifyEnabled false
39
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
39
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
40
40
  }
41
41
  }
42
42
  lintOptions {
package/dist/docs.json CHANGED
@@ -93,7 +93,7 @@
93
93
  "text": "0.0.0"
94
94
  }
95
95
  ],
96
- "docs": "Execute a single SQL statement on the specified database connection.\n\nThis method can be used to execute any SQL statement, including \n`INSERT`, `UPDATE`, `DELETE`, and `CREATE TABLE`.",
96
+ "docs": "Execute a single SQL statement on the specified database connection.\n\nThis method can be used to execute any SQL statement, including\n`INSERT`, `UPDATE`, `DELETE`, and `CREATE TABLE`.",
97
97
  "complexTypes": [
98
98
  "ExecuteOptions"
99
99
  ],
@@ -139,7 +139,7 @@
139
139
  "text": "0.0.0"
140
140
  }
141
141
  ],
142
- "docs": "Query the database and return the result set.\n\nThis method can be used to execute `SELECT` statements \nand retrieve the result set.",
142
+ "docs": "Query the database and return the result set.\n\nThis method can be used to execute `SELECT` statements\nand retrieve the result set.",
143
143
  "complexTypes": [
144
144
  "QueryResult",
145
145
  "QueryOptions"
@@ -327,7 +327,7 @@
327
327
  "name": "since"
328
328
  }
329
329
  ],
330
- "docs": "The authentication token for the database.\n\nThis is required for connecting to a remote database.\nIf the database is local (i.e., a file on the device), \nthis can be omitted.",
330
+ "docs": "The authentication token for the database.\n\nThis is required for connecting to a remote database.\nIf the database is local (i.e., a file on the device),\nthis can be omitted.",
331
331
  "complexTypes": [],
332
332
  "type": "string | undefined"
333
333
  },
@@ -343,7 +343,7 @@
343
343
  "name": "example"
344
344
  }
345
345
  ],
346
- "docs": "The path to the database file.\n\nIf no path or URL is provided, the plugin will create \na new in-memory database.\n\nIf no file exists at the specified path, \na new file will be created.",
346
+ "docs": "The path to the database file.\n\nIf no path or URL is provided, the plugin will create\na new in-memory database.\n\nIf no file exists at the specified path,\na new file will be created.",
347
347
  "complexTypes": [],
348
348
  "type": "string | undefined"
349
349
  },
@@ -355,7 +355,7 @@
355
355
  "name": "since"
356
356
  }
357
357
  ],
358
- "docs": "The URL of the database.\n\nThis can be used to connect to a remote database.\nIf the URL is provided, the `authToken` must also be provided.\n\nIf no path or URL is provided, the plugin will create \na new in-memory database.",
358
+ "docs": "The URL of the database.\n\nThis can be used to connect to a remote database.\nIf the URL is provided, the `authToken` must also be provided.\n\nIf no path or URL is provided, the plugin will create\na new in-memory database.",
359
359
  "complexTypes": [],
360
360
  "type": "string | undefined"
361
361
  }
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface LibsqlPlugin {\n /**\n * Begin a transaction on the specified database connection.\n *\n * Only available on Android.\n *\n * @since 0.0.0\n */\n beginTransaction(\n options: BeginTransactionOptions,\n ): Promise<BeginTransactionResult>;\n /**\n * Commit the current transaction on the specified database connection.\n *\n * Only available on Android.\n *\n * @since 0.0.0\n */\n commitTransaction(options: CommitTransactionOptions): Promise<void>;\n /**\n * Connect to a database.\n *\n * This method must be called before any other methods that interact with the database.\n *\n * @since 0.0.0\n */\n connect(options: ConnectOptions): Promise<ConnectResult>;\n /**\n * Execute a single SQL statement on the specified database connection.\n *\n * This method can be used to execute any SQL statement, including \n * `INSERT`, `UPDATE`, `DELETE`, and `CREATE TABLE`.\n *\n * @since 0.0.0\n */\n execute(options: ExecuteOptions): Promise<void>;\n /**\n * Execute a batch of SQL statements on the specified database connection.\n *\n * This method can be used to execute multiple SQL statements in a single call.\n *\n * @since 0.0.0\n */\n executeBatch(options: ExecuteBatchOptions): Promise<void>;\n /**\n * Query the database and return the result set.\n *\n * This method can be used to execute `SELECT` statements \n * and retrieve the result set.\n *\n * @since 0.0.0\n */\n query(options: QueryOptions): Promise<QueryResult>;\n /**\n * Rollback the current transaction on the specified database connection.\n *\n * This method will undo all changes made in the current transaction.\n *\n * Only available on Android.\n *\n * @since 0.0.0\n */\n rollbackTransaction(options: RollbackTransactionOptions): Promise<void>;\n /**\n * Synchronize the database with the remote server.\n *\n * Available on iOS and Android.\n *\n * @since 0.0.0\n */\n sync(options: SyncOptions): Promise<void>;\n}\n\n/**\n * @since 0.0.0\n */\nexport interface BeginTransactionOptions {\n /**\n * The ID of the connection to begin the transaction on.\n *\n * @since 0.0.0\n */\n connectionId: string;\n}\n\n/**\n * @since 0.0.0\n */\nexport interface BeginTransactionResult {\n /**\n * The ID of the transaction that was started.\n *\n * @since 0.0.0\n */\n transactionId: string;\n}\n\n/**\n * @since 0.0.0\n */\nexport interface CommitTransactionOptions {\n /**\n * The ID of the connection to commit the transaction on.\n *\n * @since 0.0.0\n */\n connectionId: string;\n /**\n * The ID of the transaction to commit.\n *\n * @since 0.0.0\n */\n transactionId: string;\n}\n\nexport interface ConnectOptions {\n /**\n * The authentication token for the database.\n *\n * This is required for connecting to a remote database.\n * If the database is local (i.e., a file on the device), \n * this can be omitted.\n *\n * @since 0.0.0\n */\n authToken?: string;\n /**\n * The path to the database file.\n *\n * If no path or URL is provided, the plugin will create \n * a new in-memory database.\n *\n * If no file exists at the specified path, \n * a new file will be created.\n *\n * @since 0.0.0\n * @example '/data/user/0/com.example.plugin/cache/data.db'\n */\n path?: string;\n /**\n * The URL of the database.\n *\n * This can be used to connect to a remote database.\n * If the URL is provided, the `authToken` must also be provided.\n *\n * If no path or URL is provided, the plugin will create \n * a new in-memory database.\n *\n * @since 0.0.0\n */\n url?: string;\n}\n\n/**\n * @since 0.0.0\n */\nexport interface ConnectResult {\n /**\n * The ID of the connection.\n *\n * @since 0.0.0\n */\n connectionId: string;\n}\n\n/**\n * @since 0.0.0\n */\nexport interface ExecuteOptions {\n /**\n * The ID of the connection to execute the SQL statement on.\n *\n * @since 0.0.0\n */\n connectionId: string;\n /**\n * The SQL statement to execute.\n *\n * @since 0.0.0\n * @example 'INSERT INTO users (name, age) VALUES (?, ?)'\n */\n statement: string;\n /**\n * The transaction ID to use for the SQL statement.\n *\n * Only available on Android.\n *\n * @since 0.0.0\n */\n transactionId?: string;\n /**\n * The values to bind to the SQL statement.\n *\n * @since 0.0.0\n * @example ['Alice', 30]\n */\n values?: Value[];\n}\n\n/**\n * @since 0.0.0\n */\nexport interface ExecuteBatchOptions {\n /**\n * The ID of the connection to execute the batch on.\n *\n * @since 0.0.0\n */\n connectionId: string;\n /**\n * The SQL statements to execute in the batch.\n *\n * @since 0.0.0\n * @example [\n * 'INSERT INTO users (name, age) VALUES (?, ?)',\n * 'UPDATE users SET age = ? WHERE name = ?'\n * ]\n */\n statement: string[];\n /**\n * The values to bind to the SQL statements.\n *\n * @since 0.0.0\n */\n values?: Value[][];\n}\n\n/**\n * @since 0.0.0\n */\nexport interface QueryOptions {\n /**\n * The ID of the connection to query.\n *\n * @since 0.0.0\n */\n connectionId: string;\n /**\n * The SQL statement to execute.\n *\n * @since 0.0.0\n * @example 'SELECT name, age FROM users WHERE age > ?'\n */\n statement: string;\n /**\n * The transaction ID to use for the query.\n *\n * Only available on Android.\n *\n * @since 0.0.0\n */\n transactionId?: string;\n /**\n * The values to bind to the SQL statement.\n *\n * @since 0.0.0\n * @example ['Alice', 30]\n */\n values?: Value[];\n}\n\n/**\n * @since 0.0.0\n */\nexport interface QueryResult {\n /**\n * The values returned by the query.\n *\n * @since 0.0.0\n * @example [['Alice', 30], ['Bob', 25]]\n */\n rows: Value[][];\n}\n\n/**\n * @since 0.0.0\n */\nexport interface RollbackTransactionOptions {\n /**\n * The ID of the connection to rollback the transaction on.\n *\n * @since 0.0.0\n */\n connectionId: string;\n /**\n * The ID of the transaction to rollback.\n *\n * @since 0.0.0\n */\n transactionId: string;\n}\n\n/**\n * @since 0.0.0\n */\nexport interface SyncOptions {\n /**\n * The ID of the connection to sync.\n *\n * @since 0.0.0\n */\n connectionId: string;\n}\n\n/**\n * @since 0.0.0\n */\nexport type Value = string | number | null;\n"]}
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface LibsqlPlugin {\n /**\n * Begin a transaction on the specified database connection.\n *\n * Only available on Android.\n *\n * @since 0.0.0\n */\n beginTransaction(\n options: BeginTransactionOptions,\n ): Promise<BeginTransactionResult>;\n /**\n * Commit the current transaction on the specified database connection.\n *\n * Only available on Android.\n *\n * @since 0.0.0\n */\n commitTransaction(options: CommitTransactionOptions): Promise<void>;\n /**\n * Connect to a database.\n *\n * This method must be called before any other methods that interact with the database.\n *\n * @since 0.0.0\n */\n connect(options: ConnectOptions): Promise<ConnectResult>;\n /**\n * Execute a single SQL statement on the specified database connection.\n *\n * This method can be used to execute any SQL statement, including\n * `INSERT`, `UPDATE`, `DELETE`, and `CREATE TABLE`.\n *\n * @since 0.0.0\n */\n execute(options: ExecuteOptions): Promise<void>;\n /**\n * Execute a batch of SQL statements on the specified database connection.\n *\n * This method can be used to execute multiple SQL statements in a single call.\n *\n * @since 0.0.0\n */\n executeBatch(options: ExecuteBatchOptions): Promise<void>;\n /**\n * Query the database and return the result set.\n *\n * This method can be used to execute `SELECT` statements\n * and retrieve the result set.\n *\n * @since 0.0.0\n */\n query(options: QueryOptions): Promise<QueryResult>;\n /**\n * Rollback the current transaction on the specified database connection.\n *\n * This method will undo all changes made in the current transaction.\n *\n * Only available on Android.\n *\n * @since 0.0.0\n */\n rollbackTransaction(options: RollbackTransactionOptions): Promise<void>;\n /**\n * Synchronize the database with the remote server.\n *\n * Available on iOS and Android.\n *\n * @since 0.0.0\n */\n sync(options: SyncOptions): Promise<void>;\n}\n\n/**\n * @since 0.0.0\n */\nexport interface BeginTransactionOptions {\n /**\n * The ID of the connection to begin the transaction on.\n *\n * @since 0.0.0\n */\n connectionId: string;\n}\n\n/**\n * @since 0.0.0\n */\nexport interface BeginTransactionResult {\n /**\n * The ID of the transaction that was started.\n *\n * @since 0.0.0\n */\n transactionId: string;\n}\n\n/**\n * @since 0.0.0\n */\nexport interface CommitTransactionOptions {\n /**\n * The ID of the connection to commit the transaction on.\n *\n * @since 0.0.0\n */\n connectionId: string;\n /**\n * The ID of the transaction to commit.\n *\n * @since 0.0.0\n */\n transactionId: string;\n}\n\nexport interface ConnectOptions {\n /**\n * The authentication token for the database.\n *\n * This is required for connecting to a remote database.\n * If the database is local (i.e., a file on the device),\n * this can be omitted.\n *\n * @since 0.0.0\n */\n authToken?: string;\n /**\n * The path to the database file.\n *\n * If no path or URL is provided, the plugin will create\n * a new in-memory database.\n *\n * If no file exists at the specified path,\n * a new file will be created.\n *\n * @since 0.0.0\n * @example '/data/user/0/com.example.plugin/cache/data.db'\n */\n path?: string;\n /**\n * The URL of the database.\n *\n * This can be used to connect to a remote database.\n * If the URL is provided, the `authToken` must also be provided.\n *\n * If no path or URL is provided, the plugin will create\n * a new in-memory database.\n *\n * @since 0.0.0\n */\n url?: string;\n}\n\n/**\n * @since 0.0.0\n */\nexport interface ConnectResult {\n /**\n * The ID of the connection.\n *\n * @since 0.0.0\n */\n connectionId: string;\n}\n\n/**\n * @since 0.0.0\n */\nexport interface ExecuteOptions {\n /**\n * The ID of the connection to execute the SQL statement on.\n *\n * @since 0.0.0\n */\n connectionId: string;\n /**\n * The SQL statement to execute.\n *\n * @since 0.0.0\n * @example 'INSERT INTO users (name, age) VALUES (?, ?)'\n */\n statement: string;\n /**\n * The transaction ID to use for the SQL statement.\n *\n * Only available on Android.\n *\n * @since 0.0.0\n */\n transactionId?: string;\n /**\n * The values to bind to the SQL statement.\n *\n * @since 0.0.0\n * @example ['Alice', 30]\n */\n values?: Value[];\n}\n\n/**\n * @since 0.0.0\n */\nexport interface ExecuteBatchOptions {\n /**\n * The ID of the connection to execute the batch on.\n *\n * @since 0.0.0\n */\n connectionId: string;\n /**\n * The SQL statements to execute in the batch.\n *\n * @since 0.0.0\n * @example [\n * 'INSERT INTO users (name, age) VALUES (?, ?)',\n * 'UPDATE users SET age = ? WHERE name = ?'\n * ]\n */\n statement: string[];\n /**\n * The values to bind to the SQL statements.\n *\n * @since 0.0.0\n */\n values?: Value[][];\n}\n\n/**\n * @since 0.0.0\n */\nexport interface QueryOptions {\n /**\n * The ID of the connection to query.\n *\n * @since 0.0.0\n */\n connectionId: string;\n /**\n * The SQL statement to execute.\n *\n * @since 0.0.0\n * @example 'SELECT name, age FROM users WHERE age > ?'\n */\n statement: string;\n /**\n * The transaction ID to use for the query.\n *\n * Only available on Android.\n *\n * @since 0.0.0\n */\n transactionId?: string;\n /**\n * The values to bind to the SQL statement.\n *\n * @since 0.0.0\n * @example ['Alice', 30]\n */\n values?: Value[];\n}\n\n/**\n * @since 0.0.0\n */\nexport interface QueryResult {\n /**\n * The values returned by the query.\n *\n * @since 0.0.0\n * @example [['Alice', 30], ['Bob', 25]]\n */\n rows: Value[][];\n}\n\n/**\n * @since 0.0.0\n */\nexport interface RollbackTransactionOptions {\n /**\n * The ID of the connection to rollback the transaction on.\n *\n * @since 0.0.0\n */\n connectionId: string;\n /**\n * The ID of the transaction to rollback.\n *\n * @since 0.0.0\n */\n transactionId: string;\n}\n\n/**\n * @since 0.0.0\n */\nexport interface SyncOptions {\n /**\n * The ID of the connection to sync.\n *\n * @since 0.0.0\n */\n connectionId: string;\n}\n\n/**\n * @since 0.0.0\n */\nexport type Value = string | number | null;\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capawesome/capacitor-libsql",
3
- "version": "0.2.1",
4
- "description": "Capacitor plugin for libSQL databases.",
3
+ "version": "0.2.3",
4
+ "description": "Capacitor plugin for libSQL databases on Android and iOS.",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
7
7
  "types": "dist/esm/index.d.ts",
@@ -32,11 +32,20 @@
32
32
  "url": "https://opencollective.com/capawesome"
33
33
  }
34
34
  ],
35
- "homepage": "https://capawesome.io/plugins/libsql/",
35
+ "homepage": "https://capawesome.io/docs/sdks/capacitor/libsql/",
36
36
  "keywords": [
37
37
  "capacitor",
38
38
  "plugin",
39
- "native"
39
+ "native",
40
+ "capacitor-plugin",
41
+ "libsql",
42
+ "turso",
43
+ "sqlite",
44
+ "sql database",
45
+ "local database",
46
+ "remote database",
47
+ "database sync",
48
+ "offline-first"
40
49
  ],
41
50
  "scripts": {
42
51
  "verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
@@ -57,24 +66,21 @@
57
66
  },
58
67
  "devDependencies": {
59
68
  "@capacitor/android": "8.0.0",
60
- "@capacitor/cli": "8.0.0",
69
+ "@capacitor/cli": "8.4.2",
61
70
  "@capacitor/core": "8.0.0",
62
71
  "@capacitor/docgen": "0.3.1",
63
72
  "@capacitor/ios": "8.0.0",
64
73
  "@ionic/eslint-config": "0.4.0",
65
- "@ionic/swiftlint-config": "2.0.0",
66
74
  "eslint": "8.57.0",
67
- "prettier": "3.4.2",
68
- "prettier-plugin-java": "2.6.7",
75
+ "prettier-plugin-java": "2.9.7",
69
76
  "rimraf": "6.1.2",
70
- "rollup": "4.53.3",
77
+ "rollup": "4.62.3",
71
78
  "swiftlint": "2.0.0",
72
79
  "typescript": "5.9.3"
73
80
  },
74
81
  "peerDependencies": {
75
82
  "@capacitor/core": ">=8.0.0"
76
83
  },
77
- "swiftlint": "@ionic/swiftlint-config",
78
84
  "eslintConfig": {
79
85
  "extends": "@ionic/eslint-config/recommended"
80
86
  },