@capgo/capacitor-fast-sql 7.0.1 → 7.2.6

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 CHANGED
@@ -8,6 +8,16 @@
8
8
 
9
9
  High-performance native SQLite plugin with HTTP server for efficient sync operations and IndexedDB replacement.
10
10
 
11
+ ## Why Fast SQL?
12
+
13
+ Traditional Capacitor plugins serialize data through the JavaScript bridge, which becomes inefficient with large datasets. Fast SQL solves this by establishing a local HTTP server for direct native communication, making it ideal for:
14
+
15
+ - **Local-first sync systems** (CRDTs, operational transforms)
16
+ - **IndexedDB replacement** on platforms with broken/limited implementations
17
+ - **Large dataset operations** requiring high throughput
18
+ - **Batch operations** with thousands of rows
19
+ - **Binary data storage** (BLOBs, files)
20
+
11
21
  ## Documentation
12
22
 
13
23
  The most complete doc is available here: https://capgo.app/docs/plugins/fast-sql/
@@ -59,10 +69,10 @@ Add to your `AndroidManifest.xml` if needed:
59
69
  ### Basic Example
60
70
 
61
71
  ```typescript
62
- import { NativeSQL } from '@capgo/capacitor-fast-sql';
72
+ import { FastSQL } from '@capgo/capacitor-fast-sql';
63
73
 
64
74
  // Connect to database
65
- const db = await NativeSQL.connect({ database: 'myapp' });
75
+ const db = await FastSQL.connect({ database: 'myapp' });
66
76
 
67
77
  // Create table
68
78
  await db.execute(`
@@ -85,13 +95,13 @@ const users = await db.query('SELECT * FROM users WHERE name LIKE ?', ['John%'])
85
95
  console.log('Users:', users);
86
96
 
87
97
  // Close connection
88
- await NativeSQL.disconnect('myapp');
98
+ await FastSQL.disconnect('myapp');
89
99
  ```
90
100
 
91
101
  ### Transaction Example
92
102
 
93
103
  ```typescript
94
- const db = await NativeSQL.connect({ database: 'myapp' });
104
+ const db = await FastSQL.connect({ database: 'myapp' });
95
105
 
96
106
  try {
97
107
  await db.transaction(async (tx) => {
@@ -109,7 +119,7 @@ try {
109
119
  ### Batch Operations
110
120
 
111
121
  ```typescript
112
- const db = await NativeSQL.connect({ database: 'myapp' });
122
+ const db = await FastSQL.connect({ database: 'myapp' });
113
123
 
114
124
  const results = await db.executeBatch([
115
125
  { statement: 'INSERT INTO logs (message) VALUES (?)', params: ['Log 1'] },
@@ -131,6 +141,7 @@ const results = await db.executeBatch([
131
141
  * [`rollbackTransaction(...)`](#rollbacktransaction)
132
142
  * [`getPluginVersion()`](#getpluginversion)
133
143
  * [Interfaces](#interfaces)
144
+ * [Type Aliases](#type-aliases)
134
145
  * [Enums](#enums)
135
146
 
136
147
  </docgen-index>
@@ -138,7 +149,7 @@ const results = await db.executeBatch([
138
149
  <docgen-api>
139
150
  <!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
140
151
 
141
- Native SQL Plugin for high-performance SQLite database access.
152
+ Fast SQL Plugin for high-performance SQLite database access.
142
153
 
143
154
  This plugin uses a custom HTTP-based protocol for efficient data transfer,
144
155
  bypassing Capacitor's standard bridge for better performance with sync operations.
@@ -151,8 +162,8 @@ connect(options: SQLConnectionOptions) => Promise<{ port: number; token: string;
151
162
 
152
163
  Initialize the database connection and start the HTTP server.
153
164
 
154
- | Param | Type | Description |
155
- | ------------- | --------------------------------------------------------------------- | ------------------- |
165
+ | Param | Type | Description |
166
+ | ------------- | --------------------------------------------------------------------- | -------------------- |
156
167
  | **`options`** | <code><a href="#sqlconnectionoptions">SQLConnectionOptions</a></code> | - Connection options |
157
168
 
158
169
  **Returns:** <code>Promise&lt;{ port: number; token: string; database: string; }&gt;</code>
@@ -170,8 +181,8 @@ disconnect(options: { database: string; }) => Promise<void>
170
181
 
171
182
  Close database connection and stop the HTTP server.
172
183
 
173
- | Param | Type | Description |
174
- | ------------- | ---------------------------------- | --------------------- |
184
+ | Param | Type | Description |
185
+ | ------------- | ---------------------------------- | ------------------------ |
175
186
  | **`options`** | <code>{ database: string; }</code> | - Database name to close |
176
187
 
177
188
  **Since:** 0.0.1
@@ -207,9 +218,9 @@ execute(options: { database: string; statement: string; params?: SQLValue[]; })
207
218
  Execute a SQL query via Capacitor bridge (for simple queries).
208
219
  For better performance with large datasets, use the HTTP protocol directly via SQLConnection class.
209
220
 
210
- | Param | Type | Description |
211
- | ------------- | -------------------------------------------------------------------------------------------- | ------------------ |
212
- | **`options`** | <code>{ database: string; statement: string; params?: <a href="#sqlvalue">SQLValue</a>[]; }</code> | - Query parameters |
221
+ | Param | Type | Description |
222
+ | ------------- | -------------------------------------------------------------------------- | ------------------ |
223
+ | **`options`** | <code>{ database: string; statement: string; params?: SQLValue[]; }</code> | - Query parameters |
213
224
 
214
225
  **Returns:** <code>Promise&lt;<a href="#sqlresult">SQLResult</a>&gt;</code>
215
226
 
@@ -226,8 +237,8 @@ beginTransaction(options: { database: string; isolationLevel?: IsolationLevel; }
226
237
 
227
238
  Begin a database transaction.
228
239
 
229
- | Param | Type | Description |
230
- | ------------- | ------------------------------------------------------------------------------------------------------ | ----------------------- |
240
+ | Param | Type | Description |
241
+ | ------------- | ------------------------------------------------------------------------------------------------- | --------------------- |
231
242
  | **`options`** | <code>{ database: string; isolationLevel?: <a href="#isolationlevel">IsolationLevel</a>; }</code> | - Transaction options |
232
243
 
233
244
  **Since:** 0.0.1
@@ -291,23 +302,23 @@ Get the native Capacitor plugin version.
291
302
 
292
303
  Database connection options
293
304
 
294
- | Prop | Type | Description |
295
- | ------------------- | -------------------- | --------------------------------------------------- |
305
+ | Prop | Type | Description |
306
+ | ------------------- | -------------------- | ---------------------------------------------------------- |
296
307
  | **`database`** | <code>string</code> | Database name (file will be created in app data directory) |
297
- | **`encrypted`** | <code>boolean</code> | Enable encryption (iOS/Android only) |
298
- | **`encryptionKey`** | <code>string</code> | Encryption key (required if encrypted is true) |
299
- | **`readOnly`** | <code>boolean</code> | Read-only mode |
308
+ | **`encrypted`** | <code>boolean</code> | Enable encryption (iOS/Android only) |
309
+ | **`encryptionKey`** | <code>string</code> | Encryption key (required if encrypted is true) |
310
+ | **`readOnly`** | <code>boolean</code> | Read-only mode |
300
311
 
301
312
 
302
313
  #### SQLResult
303
314
 
304
315
  Result of a SQL query execution
305
316
 
306
- | Prop | Type | Description |
307
- | ------------------- | --------------------------------------------- | ---------------------------------------------------------------- |
308
- | **`rows`** | <code><a href="#sqlrow">SQLRow</a>[]</code> | Rows returned by the query (for SELECT statements) |
309
- | **`rowsAffected`** | <code>number</code> | Number of rows affected by the query (for INSERT/UPDATE/DELETE) |
310
- | **`insertId`** | <code>number</code> | ID of the last inserted row (for INSERT statements with auto-increment) |
317
+ | Prop | Type | Description |
318
+ | ------------------ | --------------------- | ----------------------------------------------------------------------- |
319
+ | **`rows`** | <code>SQLRow[]</code> | Rows returned by the query (for SELECT statements) |
320
+ | **`rowsAffected`** | <code>number</code> | Number of rows affected by the query (for INSERT/UPDATE/DELETE) |
321
+ | **`insertId`** | <code>number</code> | ID of the last inserted row (for INSERT statements with auto-increment) |
311
322
 
312
323
 
313
324
  #### SQLRow
@@ -315,19 +326,79 @@ Result of a SQL query execution
315
326
  SQL row result - values indexed by column name
316
327
 
317
328
 
318
- ### Enums
329
+ #### Uint8Array
319
330
 
331
+ A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the
332
+ requested number of bytes could not be allocated an exception is raised.
333
+
334
+ | Prop | Type | Description |
335
+ | ----------------------- | ----------------------------------------------------------- | ---------------------------------------------------------------------------- |
336
+ | **`BYTES_PER_ELEMENT`** | <code>number</code> | The size in bytes of each element in the array. |
337
+ | **`buffer`** | <code><a href="#arraybufferlike">ArrayBufferLike</a></code> | The <a href="#arraybuffer">ArrayBuffer</a> instance referenced by the array. |
338
+ | **`byteLength`** | <code>number</code> | The length in bytes of the array. |
339
+ | **`byteOffset`** | <code>number</code> | The offset in bytes of the array. |
340
+ | **`length`** | <code>number</code> | The length of the array. |
341
+
342
+ | Method | Signature | Description |
343
+ | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
344
+ | **copyWithin** | (target: number, start: number, end?: number \| undefined) =&gt; this | Returns the this object after copying a section of the array identified by start and end to the same array starting at position target |
345
+ | **every** | (predicate: (value: number, index: number, array: <a href="#uint8array">Uint8Array</a>) =&gt; unknown, thisArg?: any) =&gt; boolean | Determines whether all the members of an array satisfy the specified test. |
346
+ | **fill** | (value: number, start?: number \| undefined, end?: number \| undefined) =&gt; this | Returns the this object after filling the section identified by start and end with value |
347
+ | **filter** | (predicate: (value: number, index: number, array: <a href="#uint8array">Uint8Array</a>) =&gt; any, thisArg?: any) =&gt; <a href="#uint8array">Uint8Array</a> | Returns the elements of an array that meet the condition specified in a callback function. |
348
+ | **find** | (predicate: (value: number, index: number, obj: <a href="#uint8array">Uint8Array</a>) =&gt; boolean, thisArg?: any) =&gt; number \| undefined | Returns the value of the first element in the array where predicate is true, and undefined otherwise. |
349
+ | **findIndex** | (predicate: (value: number, index: number, obj: <a href="#uint8array">Uint8Array</a>) =&gt; boolean, thisArg?: any) =&gt; number | Returns the index of the first element in the array where predicate is true, and -1 otherwise. |
350
+ | **forEach** | (callbackfn: (value: number, index: number, array: <a href="#uint8array">Uint8Array</a>) =&gt; void, thisArg?: any) =&gt; void | Performs the specified action for each element in an array. |
351
+ | **indexOf** | (searchElement: number, fromIndex?: number \| undefined) =&gt; number | Returns the index of the first occurrence of a value in an array. |
352
+ | **join** | (separator?: string \| undefined) =&gt; string | Adds all the elements of an array separated by the specified separator string. |
353
+ | **lastIndexOf** | (searchElement: number, fromIndex?: number \| undefined) =&gt; number | Returns the index of the last occurrence of a value in an array. |
354
+ | **map** | (callbackfn: (value: number, index: number, array: <a href="#uint8array">Uint8Array</a>) =&gt; number, thisArg?: any) =&gt; <a href="#uint8array">Uint8Array</a> | Calls a defined callback function on each element of an array, and returns an array that contains the results. |
355
+ | **reduce** | (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: <a href="#uint8array">Uint8Array</a>) =&gt; number) =&gt; number | Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. |
356
+ | **reduce** | (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: <a href="#uint8array">Uint8Array</a>) =&gt; number, initialValue: number) =&gt; number | |
357
+ | **reduce** | &lt;U&gt;(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: <a href="#uint8array">Uint8Array</a>) =&gt; U, initialValue: U) =&gt; U | Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. |
358
+ | **reduceRight** | (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: <a href="#uint8array">Uint8Array</a>) =&gt; number) =&gt; number | Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. |
359
+ | **reduceRight** | (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: <a href="#uint8array">Uint8Array</a>) =&gt; number, initialValue: number) =&gt; number | |
360
+ | **reduceRight** | &lt;U&gt;(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: <a href="#uint8array">Uint8Array</a>) =&gt; U, initialValue: U) =&gt; U | Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. |
361
+ | **reverse** | () =&gt; <a href="#uint8array">Uint8Array</a> | Reverses the elements in an Array. |
362
+ | **set** | (array: <a href="#arraylike">ArrayLike</a>&lt;number&gt;, offset?: number \| undefined) =&gt; void | Sets a value or an array of values. |
363
+ | **slice** | (start?: number \| undefined, end?: number \| undefined) =&gt; <a href="#uint8array">Uint8Array</a> | Returns a section of an array. |
364
+ | **some** | (predicate: (value: number, index: number, array: <a href="#uint8array">Uint8Array</a>) =&gt; unknown, thisArg?: any) =&gt; boolean | Determines whether the specified callback function returns true for any element of an array. |
365
+ | **sort** | (compareFn?: ((a: number, b: number) =&gt; number) \| undefined) =&gt; this | Sorts an array. |
366
+ | **subarray** | (begin?: number \| undefined, end?: number \| undefined) =&gt; <a href="#uint8array">Uint8Array</a> | Gets a new <a href="#uint8array">Uint8Array</a> view of the <a href="#arraybuffer">ArrayBuffer</a> store for this array, referencing the elements at begin, inclusive, up to end, exclusive. |
367
+ | **toLocaleString** | () =&gt; string | Converts a number to a string by using the current locale. |
368
+ | **toString** | () =&gt; string | Returns a string representation of an array. |
369
+ | **valueOf** | () =&gt; <a href="#uint8array">Uint8Array</a> | Returns the primitive value of the specified object. |
370
+
371
+
372
+ #### ArrayLike
373
+
374
+ | Prop | Type |
375
+ | ------------ | ------------------- |
376
+ | **`length`** | <code>number</code> |
377
+
378
+
379
+ #### ArrayBufferTypes
380
+
381
+ Allowed <a href="#arraybuffer">ArrayBuffer</a> types for the buffer of an ArrayBufferView and related Typed Arrays.
382
+
383
+ | Prop | Type |
384
+ | ----------------- | --------------------------------------------------- |
385
+ | **`ArrayBuffer`** | <code><a href="#arraybuffer">ArrayBuffer</a></code> |
320
386
 
321
- #### IsolationLevel
322
387
 
323
- Transaction isolation levels
388
+ #### ArrayBuffer
324
389
 
325
- | Members | Value |
326
- | ---------------------- | ------------------------------ |
327
- | **`ReadUncommitted`** | <code>'READ UNCOMMITTED'</code> |
328
- | **`ReadCommitted`** | <code>'READ COMMITTED'</code> |
329
- | **`RepeatableRead`** | <code>'REPEATABLE READ'</code> |
330
- | **`Serializable`** | <code>'SERIALIZABLE'</code> |
390
+ Represents a raw buffer of binary data, which is used to store data for the
391
+ different typed arrays. ArrayBuffers cannot be read from or written to directly,
392
+ but can be passed to a typed array or DataView Object to interpret the raw
393
+ buffer as needed.
394
+
395
+ | Prop | Type | Description |
396
+ | ---------------- | ------------------- | ------------------------------------------------------------------------------- |
397
+ | **`byteLength`** | <code>number</code> | Read-only. The length of the <a href="#arraybuffer">ArrayBuffer</a> (in bytes). |
398
+
399
+ | Method | Signature | Description |
400
+ | --------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------- |
401
+ | **slice** | (begin: number, end?: number \| undefined) =&gt; <a href="#arraybuffer">ArrayBuffer</a> | Returns a section of an <a href="#arraybuffer">ArrayBuffer</a>. |
331
402
 
332
403
 
333
404
  ### Type Aliases
@@ -335,6 +406,26 @@ Transaction isolation levels
335
406
 
336
407
  #### SQLValue
337
408
 
338
- <code>string | number | boolean | null | Uint8Array</code>
409
+ SQL value types supported by the plugin
410
+
411
+ <code>string | number | boolean | null | <a href="#uint8array">Uint8Array</a></code>
412
+
413
+
414
+ #### ArrayBufferLike
415
+
416
+ <code>ArrayBufferTypes[keyof ArrayBufferTypes]</code>
417
+
418
+
419
+ ### Enums
420
+
421
+
422
+ #### IsolationLevel
423
+
424
+ | Members | Value |
425
+ | --------------------- | ------------------------------- |
426
+ | **`ReadUncommitted`** | <code>'READ UNCOMMITTED'</code> |
427
+ | **`ReadCommitted`** | <code>'READ COMMITTED'</code> |
428
+ | **`RepeatableRead`** | <code>'REPEATABLE READ'</code> |
429
+ | **`Serializable`** | <code>'SERIALIZABLE'</code> |
339
430
 
340
431
  </docgen-api>
@@ -18,7 +18,7 @@ buildscript {
18
18
  apply plugin: 'com.android.library'
19
19
 
20
20
  android {
21
- namespace 'app.capgo.capacitor.fastsql'
21
+ namespace "app.capgo.capacitor.fastsql"
22
22
  compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35
23
23
  defaultConfig {
24
24
  minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23
@@ -6,7 +6,6 @@ import com.getcapacitor.Plugin;
6
6
  import com.getcapacitor.PluginCall;
7
7
  import com.getcapacitor.PluginMethod;
8
8
  import com.getcapacitor.annotation.CapacitorPlugin;
9
-
10
9
  import java.io.File;
11
10
  import java.util.HashMap;
12
11
  import java.util.Map;
@@ -20,6 +19,8 @@ import java.util.Map;
20
19
  @CapacitorPlugin(name = "CapgoCapacitorFastSql")
21
20
  public class CapgoCapacitorFastSqlPlugin extends Plugin {
22
21
 
22
+ private final String PLUGIN_VERSION = "7.2.6";
23
+
23
24
  private Map<String, SQLDatabase> databases = new HashMap<>();
24
25
  private SQLHTTPServer server;
25
26
 
@@ -213,6 +214,13 @@ public class CapgoCapacitorFastSqlPlugin extends Plugin {
213
214
  }
214
215
  }
215
216
 
217
+ @PluginMethod
218
+ public void getPluginVersion(PluginCall call) {
219
+ JSObject ret = new JSObject();
220
+ ret.put("version", PLUGIN_VERSION);
221
+ call.resolve(ret);
222
+ }
223
+
216
224
  private File getDatabasePath(String database) {
217
225
  File dataDir = getContext().getFilesDir();
218
226
  return new File(dataDir, database + ".db");
@@ -4,21 +4,19 @@ import android.database.Cursor;
4
4
  import android.database.sqlite.SQLiteDatabase;
5
5
  import android.database.sqlite.SQLiteStatement;
6
6
  import android.util.Base64;
7
-
8
7
  import com.getcapacitor.JSArray;
9
8
  import com.getcapacitor.JSObject;
10
-
9
+ import java.util.ArrayList;
10
+ import java.util.List;
11
11
  import org.json.JSONArray;
12
12
  import org.json.JSONException;
13
13
  import org.json.JSONObject;
14
14
 
15
- import java.util.ArrayList;
16
- import java.util.List;
17
-
18
15
  /**
19
16
  * SQLite database wrapper for Android
20
17
  */
21
18
  public class SQLDatabase {
19
+
22
20
  private SQLiteDatabase db;
23
21
  private boolean inTransaction = false;
24
22
 
@@ -41,9 +39,8 @@ public class SQLDatabase {
41
39
 
42
40
  // Check if this is a query (SELECT) or a modification (INSERT/UPDATE/DELETE)
43
41
  String trimmedStatement = statement.trim().toUpperCase();
44
- boolean isQuery = trimmedStatement.startsWith("SELECT") ||
45
- trimmedStatement.startsWith("PRAGMA") ||
46
- trimmedStatement.startsWith("EXPLAIN");
42
+ boolean isQuery =
43
+ trimmedStatement.startsWith("SELECT") || trimmedStatement.startsWith("PRAGMA") || trimmedStatement.startsWith("EXPLAIN");
47
44
 
48
45
  if (isQuery) {
49
46
  return executeQuery(statement, params);
@@ -7,15 +7,12 @@ import com.google.gson.JsonArray;
7
7
  import com.google.gson.JsonElement;
8
8
  import com.google.gson.JsonObject;
9
9
  import com.google.gson.JsonParser;
10
-
11
- import org.json.JSONArray;
12
- import org.json.JSONObject;
13
-
10
+ import fi.iki.elonen.NanoHTTPD; // Note: org.nanohttpd:nanohttpd:2.3.1 still uses fi.iki.elonen package
14
11
  import java.io.IOException;
15
12
  import java.security.SecureRandom;
16
13
  import java.util.Map;
17
-
18
- import fi.iki.elonen.NanoHTTPD; // Note: org.nanohttpd:nanohttpd:2.3.1 still uses fi.iki.elonen package
14
+ import org.json.JSONArray;
15
+ import org.json.JSONObject;
19
16
 
20
17
  /**
21
18
  * HTTP server for efficient SQL operations
@@ -24,6 +21,7 @@ import fi.iki.elonen.NanoHTTPD; // Note: org.nanohttpd:nanohttpd:2.3.1 still us
24
21
  * bridge for better performance with large datasets and sync operations.
25
22
  */
26
23
  public class SQLHTTPServer extends NanoHTTPD {
24
+
27
25
  private final String token;
28
26
  private final Map<String, SQLDatabase> databases;
29
27
  private final Gson gson = new Gson();
@@ -80,8 +78,7 @@ public class SQLHTTPServer extends NanoHTTPD {
80
78
  return newFixedLengthResponse(Response.Status.NOT_FOUND, "text/plain", "Endpoint not found");
81
79
  }
82
80
  } catch (Exception e) {
83
- return newFixedLengthResponse(Response.Status.INTERNAL_ERROR, "text/plain",
84
- "Error: " + e.getMessage());
81
+ return newFixedLengthResponse(Response.Status.INTERNAL_ERROR, "text/plain", "Error: " + e.getMessage());
85
82
  }
86
83
  }
87
84
 
@@ -69,14 +69,14 @@ export declare enum IsolationLevel {
69
69
  Serializable = "SERIALIZABLE"
70
70
  }
71
71
  /**
72
- * Native SQL Plugin for high-performance SQLite database access.
72
+ * Fast SQL Plugin for high-performance SQLite database access.
73
73
  *
74
74
  * This plugin uses a custom HTTP-based protocol for efficient data transfer,
75
75
  * bypassing Capacitor's standard bridge for better performance with sync operations.
76
76
  *
77
77
  * @since 0.0.1
78
78
  */
79
- export interface CapgoCapacitorNativeSqlPlugin {
79
+ export interface CapgoCapacitorFastSqlPlugin {
80
80
  /**
81
81
  * Initialize the database connection and start the HTTP server.
82
82
  *
@@ -86,7 +86,7 @@ export interface CapgoCapacitorNativeSqlPlugin {
86
86
  * @since 0.0.1
87
87
  * @example
88
88
  * ```typescript
89
- * const conn = await CapgoCapacitorNativeSql.connect({ database: 'myapp' });
89
+ * const conn = await CapgoCapacitorFastSql.connect({ database: 'myapp' });
90
90
  * console.log('Connected on port:', conn.port);
91
91
  * ```
92
92
  */
@@ -104,7 +104,7 @@ export interface CapgoCapacitorNativeSqlPlugin {
104
104
  * @since 0.0.1
105
105
  * @example
106
106
  * ```typescript
107
- * await CapgoCapacitorNativeSql.disconnect({ database: 'myapp' });
107
+ * await CapgoCapacitorFastSql.disconnect({ database: 'myapp' });
108
108
  * ```
109
109
  */
110
110
  disconnect(options: {
@@ -119,7 +119,7 @@ export interface CapgoCapacitorNativeSqlPlugin {
119
119
  * @since 0.0.1
120
120
  * @example
121
121
  * ```typescript
122
- * const info = await CapgoCapacitorNativeSql.getServerInfo({ database: 'myapp' });
122
+ * const info = await CapgoCapacitorFastSql.getServerInfo({ database: 'myapp' });
123
123
  * console.log('Server port:', info.port);
124
124
  * ```
125
125
  */
@@ -139,7 +139,7 @@ export interface CapgoCapacitorNativeSqlPlugin {
139
139
  * @since 0.0.1
140
140
  * @example
141
141
  * ```typescript
142
- * const result = await CapgoCapacitorNativeSql.execute({
142
+ * const result = await CapgoCapacitorFastSql.execute({
143
143
  * database: 'myapp',
144
144
  * statement: 'SELECT * FROM users WHERE age > ?',
145
145
  * params: [18]
@@ -161,9 +161,9 @@ export interface CapgoCapacitorNativeSqlPlugin {
161
161
  * @since 0.0.1
162
162
  * @example
163
163
  * ```typescript
164
- * await CapgoCapacitorNativeSql.beginTransaction({ database: 'myapp' });
164
+ * await CapgoCapacitorFastSql.beginTransaction({ database: 'myapp' });
165
165
  * // Execute multiple operations
166
- * await CapgoCapacitorNativeSql.commitTransaction({ database: 'myapp' });
166
+ * await CapgoCapacitorFastSql.commitTransaction({ database: 'myapp' });
167
167
  * ```
168
168
  */
169
169
  beginTransaction(options: {
@@ -179,7 +179,7 @@ export interface CapgoCapacitorNativeSqlPlugin {
179
179
  * @since 0.0.1
180
180
  * @example
181
181
  * ```typescript
182
- * await CapgoCapacitorNativeSql.commitTransaction({ database: 'myapp' });
182
+ * await CapgoCapacitorFastSql.commitTransaction({ database: 'myapp' });
183
183
  * ```
184
184
  */
185
185
  commitTransaction(options: {
@@ -195,11 +195,11 @@ export interface CapgoCapacitorNativeSqlPlugin {
195
195
  * @example
196
196
  * ```typescript
197
197
  * try {
198
- * await CapgoCapacitorNativeSql.beginTransaction({ database: 'myapp' });
198
+ * await CapgoCapacitorFastSql.beginTransaction({ database: 'myapp' });
199
199
  * // Operations...
200
- * await CapgoCapacitorNativeSql.commitTransaction({ database: 'myapp' });
200
+ * await CapgoCapacitorFastSql.commitTransaction({ database: 'myapp' });
201
201
  * } catch (error) {
202
- * await CapgoCapacitorNativeSql.rollbackTransaction({ database: 'myapp' });
202
+ * await CapgoCapacitorFastSql.rollbackTransaction({ database: 'myapp' });
203
203
  * }
204
204
  * ```
205
205
  */
@@ -214,7 +214,7 @@ export interface CapgoCapacitorNativeSqlPlugin {
214
214
  * @since 0.0.1
215
215
  * @example
216
216
  * ```typescript
217
- * const { version } = await CapgoCapacitorNativeSql.getPluginVersion();
217
+ * const { version } = await CapgoCapacitorFastSql.getPluginVersion();
218
218
  * console.log('Plugin version:', version);
219
219
  * ```
220
220
  */
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,UAAU,CAAC;AAErE;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,IAAI,EAAE,MAAM,EAAE,CAAC;IAEf;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,QAAQ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AEhG;;;;;;;;;;;OAWG;IACH,iBAAiB,CAAC,OAAO,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhE;;;;;;;;;;;;;;;;;OAiBG;IACH,mBAAmB,CAAC,OAAO,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElE;;;;;;;;;;;OAWG;IACH,gBAAgB,IAAI,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAClD"}
@@ -1,12 +1,12 @@
1
1
  import type { SQLConnectionOptions } from './definitions';
2
2
  import { SQLConnection } from './sql-connection';
3
3
  /**
4
- * NativeSQL - High-level API for managing SQL connections
4
+ * FastSQL - High-level API for managing SQL connections
5
5
  *
6
6
  * This class provides a convenient interface for opening/closing database connections
7
7
  * and managing multiple databases simultaneously.
8
8
  */
9
- export declare class NativeSQL {
9
+ export declare class FastSQL {
10
10
  private static connections;
11
11
  /**
12
12
  * Open a database connection
@@ -39,4 +39,4 @@ export declare class NativeSQL {
39
39
  */
40
40
  static getOpenDatabases(): string[];
41
41
  }
42
- //# sourceMappingURL=native-sql.d.ts.map
42
+ //# sourceMappingURL=fast-sql.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fast-sql.d.ts","sourceRoot":"","sources":["../../src/fast-sql.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD;;;;;GAKG;AACH,qBAAa,OAAO;IAClB,OAAO,CAAC,MAAM,CAAC,WAAW,CAAyC;IAEnE;;;;;OAKG;WACU,OAAO,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,aAAa,CAAC;IAkB3E;;;;OAIG;WACU,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAaxD;;;;;OAKG;IACH,MAAM,CAAC,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI;IAI5D;;OAEG;WACU,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAK3C;;;;OAIG;IACH,MAAM,CAAC,gBAAgB,IAAI,MAAM,EAAE;CAGpC"}
@@ -1,12 +1,12 @@
1
- import { CapgoCapacitorNativeSql } from './plugin';
1
+ import { CapgoCapacitorFastSql } from './plugin';
2
2
  import { SQLConnection } from './sql-connection';
3
3
  /**
4
- * NativeSQL - High-level API for managing SQL connections
4
+ * FastSQL - High-level API for managing SQL connections
5
5
  *
6
6
  * This class provides a convenient interface for opening/closing database connections
7
7
  * and managing multiple databases simultaneously.
8
8
  */
9
- export class NativeSQL {
9
+ export class FastSQL {
10
10
  /**
11
11
  * Open a database connection
12
12
  *
@@ -19,7 +19,7 @@ export class NativeSQL {
19
19
  return this.connections.get(options.database);
20
20
  }
21
21
  // Connect via native plugin
22
- const info = await CapgoCapacitorNativeSql.connect(options);
22
+ const info = await CapgoCapacitorFastSql.connect(options);
23
23
  // Create connection instance
24
24
  const connection = new SQLConnection(info.database, info.port, info.token);
25
25
  // Store connection
@@ -37,7 +37,7 @@ export class NativeSQL {
37
37
  throw new Error(`Database '${database}' is not connected`);
38
38
  }
39
39
  // Disconnect via native plugin
40
- await CapgoCapacitorNativeSql.disconnect({ database });
40
+ await CapgoCapacitorFastSql.disconnect({ database });
41
41
  // Remove connection
42
42
  this.connections.delete(database);
43
43
  }
@@ -66,4 +66,4 @@ export class NativeSQL {
66
66
  return Array.from(this.connections.keys());
67
67
  }
68
68
  }
69
- NativeSQL.connections = new Map();
69
+ FastSQL.connections = new Map();
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Helper classes for easier SQL operations
3
- * Import these separately: import { NativeSQL, SQLConnection } from '@capgo/capacitor-native-sql/helpers';
3
+ * Import these separately: import { FastSQL, SQLConnection } from '@capgo/capacitor-fast-sql/helpers';
4
4
  */
5
- export { NativeSQL } from './native-sql';
5
+ export { FastSQL } from './fast-sql';
6
6
  export { SQLConnection } from './sql-connection';
7
7
  //# sourceMappingURL=helpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Helper classes for easier SQL operations
3
- * Import these separately: import { NativeSQL, SQLConnection } from '@capgo/capacitor-native-sql/helpers';
3
+ * Import these separately: import { FastSQL, SQLConnection } from '@capgo/capacitor-fast-sql/helpers';
4
4
  */
5
- export { NativeSQL } from './native-sql';
5
+ export { FastSQL } from './fast-sql';
6
6
  export { SQLConnection } from './sql-connection';
@@ -1,5 +1,5 @@
1
1
  export * from './definitions';
2
- export { CapgoCapacitorNativeSql } from './plugin';
3
- export { NativeSQL } from './native-sql';
2
+ export { CapgoCapacitorFastSql } from './plugin';
3
+ export { FastSQL } from './fast-sql';
4
4
  export { SQLConnection } from './sql-connection';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAGnD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAGjD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
package/dist/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from './definitions';
2
- export { CapgoCapacitorNativeSql } from './plugin';
2
+ export { CapgoCapacitorFastSql } from './plugin';
3
3
  // Re-export helper classes for convenience
4
- export { NativeSQL } from './native-sql';
4
+ export { FastSQL } from './fast-sql';
5
5
  export { SQLConnection } from './sql-connection';
@@ -1,3 +1,3 @@
1
- import type { CapgoCapacitorNativeSqlPlugin } from './definitions';
2
- export declare const CapgoCapacitorNativeSql: CapgoCapacitorNativeSqlPlugin;
1
+ import type { CapgoCapacitorFastSqlPlugin } from './definitions';
2
+ export declare const CapgoCapacitorFastSql: CapgoCapacitorFastSqlPlugin;
3
3
  //# sourceMappingURL=plugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/plugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,eAAe,CAAC;AAEnE,eAAO,MAAM,uBAAuB,+BAGhC,CAAC"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/plugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAEjE,eAAO,MAAM,qBAAqB,6BAEhC,CAAC"}