expo-sqlite 15.2.4 → 15.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.
Files changed (63) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/android/build.gradle +2 -2
  3. package/build/SQLiteDatabase.d.ts +3 -3
  4. package/build/SQLiteDatabase.js +3 -3
  5. package/build/SQLiteDatabase.js.map +1 -1
  6. package/build/SQLiteSession.d.ts +8 -9
  7. package/build/SQLiteSession.d.ts.map +1 -1
  8. package/build/SQLiteSession.js +8 -9
  9. package/build/SQLiteSession.js.map +1 -1
  10. package/build/SQLiteStatement.d.ts +7 -2
  11. package/build/SQLiteStatement.d.ts.map +1 -1
  12. package/build/SQLiteStatement.js +7 -2
  13. package/build/SQLiteStatement.js.map +1 -1
  14. package/build/hooks.js.map +1 -1
  15. package/build/paramUtils.d.ts.map +1 -1
  16. package/build/paramUtils.js +2 -0
  17. package/build/paramUtils.js.map +1 -1
  18. package/expo-module.config.json +1 -1
  19. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/15.2.6/expo.modules.sqlite-15.2.6.aar +0 -0
  20. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/15.2.6/expo.modules.sqlite-15.2.6.aar.md5 +1 -0
  21. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/15.2.6/expo.modules.sqlite-15.2.6.aar.sha1 +1 -0
  22. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/15.2.6/expo.modules.sqlite-15.2.6.aar.sha256 +1 -0
  23. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/15.2.6/expo.modules.sqlite-15.2.6.aar.sha512 +1 -0
  24. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/{15.2.4/expo.modules.sqlite-15.2.4.module → 15.2.6/expo.modules.sqlite-15.2.6.module} +17 -17
  25. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/15.2.6/expo.modules.sqlite-15.2.6.module.md5 +1 -0
  26. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/15.2.6/expo.modules.sqlite-15.2.6.module.sha1 +1 -0
  27. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/15.2.6/expo.modules.sqlite-15.2.6.module.sha256 +1 -0
  28. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/15.2.6/expo.modules.sqlite-15.2.6.module.sha512 +1 -0
  29. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/{15.2.4/expo.modules.sqlite-15.2.4.pom → 15.2.6/expo.modules.sqlite-15.2.6.pom} +1 -1
  30. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/15.2.6/expo.modules.sqlite-15.2.6.pom.md5 +1 -0
  31. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/15.2.6/expo.modules.sqlite-15.2.6.pom.sha1 +1 -0
  32. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/15.2.6/expo.modules.sqlite-15.2.6.pom.sha256 +1 -0
  33. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/15.2.6/expo.modules.sqlite-15.2.6.pom.sha512 +1 -0
  34. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/maven-metadata.xml +4 -4
  35. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/maven-metadata.xml.md5 +1 -1
  36. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/maven-metadata.xml.sha1 +1 -1
  37. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/maven-metadata.xml.sha256 +1 -1
  38. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/maven-metadata.xml.sha512 +1 -1
  39. package/package.json +3 -3
  40. package/src/SQLiteDatabase.ts +3 -3
  41. package/src/SQLiteSession.ts +8 -9
  42. package/src/SQLiteStatement.ts +7 -2
  43. package/src/hooks.tsx +2 -2
  44. package/src/paramUtils.ts +4 -2
  45. package/src/ts-declarations/whatwg-url-without-unicode.d.ts +4 -0
  46. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/15.2.4/expo.modules.sqlite-15.2.4.aar +0 -0
  47. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/15.2.4/expo.modules.sqlite-15.2.4.aar.md5 +0 -1
  48. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/15.2.4/expo.modules.sqlite-15.2.4.aar.sha1 +0 -1
  49. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/15.2.4/expo.modules.sqlite-15.2.4.aar.sha256 +0 -1
  50. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/15.2.4/expo.modules.sqlite-15.2.4.aar.sha512 +0 -1
  51. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/15.2.4/expo.modules.sqlite-15.2.4.module.md5 +0 -1
  52. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/15.2.4/expo.modules.sqlite-15.2.4.module.sha1 +0 -1
  53. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/15.2.4/expo.modules.sqlite-15.2.4.module.sha256 +0 -1
  54. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/15.2.4/expo.modules.sqlite-15.2.4.module.sha512 +0 -1
  55. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/15.2.4/expo.modules.sqlite-15.2.4.pom.md5 +0 -1
  56. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/15.2.4/expo.modules.sqlite-15.2.4.pom.sha1 +0 -1
  57. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/15.2.4/expo.modules.sqlite-15.2.4.pom.sha256 +0 -1
  58. package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/15.2.4/expo.modules.sqlite-15.2.4.pom.sha512 +0 -1
  59. /package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/{15.2.4/expo.modules.sqlite-15.2.4-sources.jar → 15.2.6/expo.modules.sqlite-15.2.6-sources.jar} +0 -0
  60. /package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/{15.2.4/expo.modules.sqlite-15.2.4-sources.jar.md5 → 15.2.6/expo.modules.sqlite-15.2.6-sources.jar.md5} +0 -0
  61. /package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/{15.2.4/expo.modules.sqlite-15.2.4-sources.jar.sha1 → 15.2.6/expo.modules.sqlite-15.2.6-sources.jar.sha1} +0 -0
  62. /package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/{15.2.4/expo.modules.sqlite-15.2.4-sources.jar.sha256 → 15.2.6/expo.modules.sqlite-15.2.6-sources.jar.sha256} +0 -0
  63. /package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/{15.2.4/expo.modules.sqlite-15.2.4-sources.jar.sha512 → 15.2.6/expo.modules.sqlite-15.2.6-sources.jar.sha512} +0 -0
package/CHANGELOG.md CHANGED
@@ -10,6 +10,14 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 15.2.6 — 2025-04-21
14
+
15
+ _This version does not introduce any user-facing changes._
16
+
17
+ ## 15.2.5 — 2025-04-14
18
+
19
+ _This version does not introduce any user-facing changes._
20
+
13
21
  ## 15.2.4 — 2025-04-11
14
22
 
15
23
  _This version does not introduce any user-facing changes._
@@ -45,13 +45,13 @@ def reactNativeArchitectures() {
45
45
  }
46
46
 
47
47
  group = 'host.exp.exponent'
48
- version = '15.2.4'
48
+ version = '15.2.6'
49
49
 
50
50
  android {
51
51
  namespace "expo.modules.sqlite"
52
52
  defaultConfig {
53
53
  versionCode 18
54
- versionName "15.2.4"
54
+ versionName "15.2.6"
55
55
  buildConfigField "boolean", "USE_LIBSQL", project.ext.USE_LIBSQL.toString()
56
56
 
57
57
  externalNativeBuild {
@@ -129,10 +129,10 @@ export declare class SQLiteDatabase {
129
129
  prepareSync(source: string): SQLiteStatement;
130
130
  /**
131
131
  * Create a new session for the database.
132
- * @see [`sqlite3session_create`](https://www.sqlite.org/session/sqlite3session_create.html)
133
132
  *
134
133
  * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.
135
134
  *
135
+ * @see [`sqlite3session_create`](https://www.sqlite.org/session/sqlite3session_create.html)
136
136
  * @param dbName The name of the database to create a session for. The default value is `main`.
137
137
  */
138
138
  createSessionSync(dbName?: string): SQLiteSession;
@@ -321,10 +321,10 @@ export declare function backupDatabaseAsync({ sourceDatabase, sourceDatabaseName
321
321
  /**
322
322
  * Backup a database to another database.
323
323
  *
324
- * @see https://www.sqlite.org/c3ref/backup_finish.html
325
- *
326
324
  * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.
327
325
  *
326
+ * @see https://www.sqlite.org/c3ref/backup_finish.html
327
+ *
328
328
  * @param options - The backup options
329
329
  * @param options.sourceDatabase - The source database to backup from
330
330
  * @param options.sourceDatabaseName - The name of the source database. The default value is `main`
@@ -193,10 +193,10 @@ export class SQLiteDatabase {
193
193
  }
194
194
  /**
195
195
  * Create a new session for the database.
196
- * @see [`sqlite3session_create`](https://www.sqlite.org/session/sqlite3session_create.html)
197
196
  *
198
197
  * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.
199
198
  *
199
+ * @see [`sqlite3session_create`](https://www.sqlite.org/session/sqlite3session_create.html)
200
200
  * @param dbName The name of the database to create a session for. The default value is `main`.
201
201
  */
202
202
  createSessionSync(dbName = 'main') {
@@ -428,10 +428,10 @@ export function backupDatabaseAsync({ sourceDatabase, sourceDatabaseName, destDa
428
428
  /**
429
429
  * Backup a database to another database.
430
430
  *
431
- * @see https://www.sqlite.org/c3ref/backup_finish.html
432
- *
433
431
  * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.
434
432
  *
433
+ * @see https://www.sqlite.org/c3ref/backup_finish.html
434
+ *
435
435
  * @param options - The backup options
436
436
  * @param options.sourceDatabase - The source database to backup from
437
437
  * @param options.sourceDatabaseName - The name of the source database. The default value is `main`
@@ -1 +1 @@
1
- {"version":3,"file":"SQLiteDatabase.js","sourceRoot":"","sources":["../src/SQLiteDatabase.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO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AkB,IAAI,MAAM,CAC7B,CAAC;AACJ,CAAC;AAmBD;;;;;;GAMG;AACH,MAAM,UAAU,yBAAyB,CACvC,QAA8C;IAE9C,OAAO,UAAU,CAAC,WAAW,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC;AAC9D,CAAC;AAED;;;GAGG;AACH,MAAM,WAAY,SAAQ,cAAc;IAC/B,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,EAAkB;QAChD,MAAM,OAAO,GAAG,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC;QAC1D,MAAM,cAAc,GAAG,IAAI,UAAU,CAAC,cAAc,CAClD,EAAE,CAAC,YAAY,EACf,kBAAkB,CAAC,OAAO,CAAC,CAC5B,CAAC;QACF,MAAM,cAAc,CAAC,SAAS,EAAE,CAAC;QACjC,OAAO,IAAI,WAAW,CAAC,EAAE,CAAC,YAAY,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;IACnE,CAAC;CACF","sourcesContent":["import { type EventSubscription } from 'expo-modules-core';\nimport { Platform } from 'react-native';\n\nimport ExpoSQLite from './ExpoSQLite';\nimport { flattenOpenOptions, NativeDatabase, SQLiteOpenOptions } from './NativeDatabase';\nimport { SQLiteSession } from './SQLiteSession';\nimport {\n SQLiteBindParams,\n SQLiteExecuteAsyncResult,\n SQLiteExecuteSyncResult,\n SQLiteRunResult,\n SQLiteStatement,\n SQLiteVariadicBindParams,\n} from './SQLiteStatement';\nimport { createDatabasePath } from './pathUtils';\n\nexport { SQLiteOpenOptions };\n\n/**\n * A SQLite database.\n */\nexport class SQLiteDatabase {\n constructor(\n public readonly databasePath: string,\n public readonly options: SQLiteOpenOptions,\n public readonly nativeDatabase: NativeDatabase\n ) {}\n\n /**\n * Asynchronous call to return whether the database is currently in a transaction.\n */\n public isInTransactionAsync(): Promise<boolean> {\n return this.nativeDatabase.isInTransactionAsync();\n }\n\n /**\n * Close the database.\n */\n public closeAsync(): Promise<void> {\n return this.nativeDatabase.closeAsync();\n }\n\n /**\n * Execute all SQL queries in the supplied string.\n * > Note: The queries are not escaped for you! Be careful when constructing your queries.\n *\n * @param source A string containing all the SQL queries.\n */\n public execAsync(source: string): Promise<void> {\n return this.nativeDatabase.execAsync(source);\n }\n\n /**\n * [Serialize the database](https://sqlite.org/c3ref/serialize.html) as `Uint8Array`.\n *\n * @param databaseName The name of the current attached databases. The default value is `main` which is the default database name.\n */\n public serializeAsync(databaseName: string = 'main'): Promise<Uint8Array> {\n return this.nativeDatabase.serializeAsync(databaseName);\n }\n\n /**\n * Create a [prepared SQLite statement](https://www.sqlite.org/c3ref/prepare.html).\n *\n * @param source A string containing the SQL query.\n */\n public async prepareAsync(source: string): Promise<SQLiteStatement> {\n const nativeStatement = new ExpoSQLite.NativeStatement();\n await this.nativeDatabase.prepareAsync(nativeStatement, source);\n return new SQLiteStatement(this.nativeDatabase, nativeStatement);\n }\n\n /**\n * Create a new session for the database.\n * @see [`sqlite3session_create`](https://www.sqlite.org/session/sqlite3session_create.html)\n * @param dbName The name of the database to create a session for. The default value is `main`.\n */\n public async createSessionAsync(dbName: string = 'main'): Promise<SQLiteSession> {\n const nativeSession = new ExpoSQLite.NativeSession();\n await this.nativeDatabase.createSessionAsync(nativeSession, dbName);\n return new SQLiteSession(this.nativeDatabase, nativeSession);\n }\n\n /**\n * Execute a transaction and automatically commit/rollback based on the `task` result.\n *\n * > **Note:** This transaction is not exclusive and can be interrupted by other async queries.\n *\n * @example\n * ```ts\n * db.withTransactionAsync(async () => {\n * await db.execAsync('UPDATE test SET name = \"aaa\"');\n *\n * //\n * // We cannot control the order of async/await order, so order of execution is not guaranteed.\n * // The following UPDATE query out of transaction may be executed here and break the expectation.\n * //\n *\n * const result = await db.getFirstAsync<{ name: string }>('SELECT name FROM Users');\n * expect(result?.name).toBe('aaa');\n * });\n * db.execAsync('UPDATE test SET name = \"bbb\"');\n * ```\n * If you worry about the order of execution, use `withExclusiveTransactionAsync` instead.\n *\n * @param task An async function to execute within a transaction.\n */\n public async withTransactionAsync(task: () => Promise<void>): Promise<void> {\n try {\n await this.execAsync('BEGIN');\n await task();\n await this.execAsync('COMMIT');\n } catch (e) {\n await this.execAsync('ROLLBACK');\n throw e;\n }\n }\n\n /**\n * Execute a transaction and automatically commit/rollback based on the `task` result.\n *\n * The transaction may be exclusive.\n * As long as the transaction is converted into a write transaction,\n * the other async write queries will abort with `database is locked` error.\n *\n * > **Note:** This function is not supported on web.\n *\n * @param task An async function to execute within a transaction. Any queries inside the transaction must be executed on the `txn` object.\n * The `txn` object has the same interfaces as the [`SQLiteDatabase`](#sqlitedatabase) object. You can use `txn` like a [`SQLiteDatabase`](#sqlitedatabase) object.\n *\n * @platform android\n * @platform ios\n * @platform macos\n *\n * @example\n * ```ts\n * db.withExclusiveTransactionAsync(async (txn) => {\n * await txn.execAsync('UPDATE test SET name = \"aaa\"');\n * });\n * ```\n */\n public async withExclusiveTransactionAsync(\n task: (txn: Transaction) => Promise<void>\n ): Promise<void> {\n if (Platform.OS === 'web') {\n throw new Error('withExclusiveTransactionAsync is not supported on web');\n }\n const transaction = await Transaction.createAsync(this);\n let error;\n try {\n await transaction.execAsync('BEGIN');\n await task(transaction);\n await transaction.execAsync('COMMIT');\n } catch (e) {\n await transaction.execAsync('ROLLBACK');\n error = e;\n } finally {\n await transaction.closeAsync();\n }\n if (error) {\n throw error;\n }\n }\n\n /**\n * Synchronous call to return whether the database is currently in a transaction.\n */\n public isInTransactionSync(): boolean {\n return this.nativeDatabase.isInTransactionSync();\n }\n\n /**\n * Close the database.\n */\n public closeSync(): void {\n return this.nativeDatabase.closeSync();\n }\n\n /**\n * Execute all SQL queries in the supplied string.\n *\n * > **Note:** The queries are not escaped for you! Be careful when constructing your queries.\n *\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n *\n * @param source A string containing all the SQL queries.\n */\n public execSync(source: string): void {\n return this.nativeDatabase.execSync(source);\n }\n\n /**\n * [Serialize the database](https://sqlite.org/c3ref/serialize.html) as `Uint8Array`.\n *\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n *\n * @param databaseName The name of the current attached databases. The default value is `main` which is the default database name.\n */\n public serializeSync(databaseName: string = 'main'): Uint8Array {\n return this.nativeDatabase.serializeSync(databaseName);\n }\n\n /**\n * Create a [prepared SQLite statement](https://www.sqlite.org/c3ref/prepare.html).\n *\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n *\n * @param source A string containing the SQL query.\n */\n public prepareSync(source: string): SQLiteStatement {\n const nativeStatement = new ExpoSQLite.NativeStatement();\n this.nativeDatabase.prepareSync(nativeStatement, source);\n return new SQLiteStatement(this.nativeDatabase, nativeStatement);\n }\n\n /**\n * Create a new session for the database.\n * @see [`sqlite3session_create`](https://www.sqlite.org/session/sqlite3session_create.html)\n *\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n *\n * @param dbName The name of the database to create a session for. The default value is `main`.\n */\n public createSessionSync(dbName: string = 'main'): SQLiteSession {\n const nativeSession = new ExpoSQLite.NativeSession();\n this.nativeDatabase.createSessionSync(nativeSession, dbName);\n return new SQLiteSession(this.nativeDatabase, nativeSession);\n }\n\n /**\n * Execute a transaction and automatically commit/rollback based on the `task` result.\n *\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n *\n * @param task An async function to execute within a transaction.\n */\n public withTransactionSync(task: () => void): void {\n try {\n this.execSync('BEGIN');\n task();\n this.execSync('COMMIT');\n } catch (e) {\n this.execSync('ROLLBACK');\n throw e;\n }\n }\n\n //#region Statement API shorthands\n\n /**\n * A convenience wrapper around [`SQLiteDatabase.prepareAsync()`](#prepareasyncsource), [`SQLiteStatement.executeAsync()`](#executeasyncparams), and [`SQLiteStatement.finalizeAsync()`](#finalizeasync).\n * @param source A string containing the SQL query.\n * @param params The parameters to bind to the prepared statement. You can pass values in array, object, or variadic arguments. See [`SQLiteBindValue`](#sqlitebindvalue) for more information about binding values.\n */\n public runAsync(source: string, params: SQLiteBindParams): Promise<SQLiteRunResult>;\n\n /**\n * @hidden\n */\n public runAsync(source: string, ...params: SQLiteVariadicBindParams): Promise<SQLiteRunResult>;\n public async runAsync(source: string, ...params: any[]): Promise<SQLiteRunResult> {\n const statement = await this.prepareAsync(source);\n let result: SQLiteExecuteAsyncResult<unknown>;\n try {\n result = await statement.executeAsync(...params);\n } finally {\n await statement.finalizeAsync();\n }\n return result;\n }\n\n /**\n * A convenience wrapper around [`SQLiteDatabase.prepareAsync()`](#prepareasyncsource), [`SQLiteStatement.executeAsync()`](#executeasyncparams), [`SQLiteExecuteAsyncResult.getFirstAsync()`](#getfirstasync), and [`SQLiteStatement.finalizeAsync()`](#finalizeasync).\n * @param source A string containing the SQL query.\n * @param params The parameters to bind to the prepared statement. You can pass values in array, object, or variadic arguments. See [`SQLiteBindValue`](#sqlitebindvalue) for more information about binding values.\n */\n public getFirstAsync<T>(source: string, params: SQLiteBindParams): Promise<T | null>;\n /**\n * @hidden\n */\n public getFirstAsync<T>(source: string, ...params: SQLiteVariadicBindParams): Promise<T | null>;\n public async getFirstAsync<T>(source: string, ...params: any[]): Promise<T | null> {\n const statement = await this.prepareAsync(source);\n let firstRow: T | null;\n try {\n const result = await statement.executeAsync<T>(...params);\n firstRow = await result.getFirstAsync();\n } finally {\n await statement.finalizeAsync();\n }\n return firstRow;\n }\n\n /**\n * A convenience wrapper around [`SQLiteDatabase.prepareAsync()`](#prepareasyncsource), [`SQLiteStatement.executeAsync()`](#executeasyncparams), [`SQLiteExecuteAsyncResult`](#sqliteexecuteasyncresult) `AsyncIterator`, and [`SQLiteStatement.finalizeAsync()`](#finalizeasync).\n * @param source A string containing the SQL query.\n * @param params The parameters to bind to the prepared statement. You can pass values in array, object, or variadic arguments. See [`SQLiteBindValue`](#sqlitebindvalue) for more information about binding values.\n * @returns Rather than returning Promise, this function returns an [`AsyncIterableIterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AsyncIterator). You can use `for await...of` to iterate over the rows from the SQLite query result.\n */\n public getEachAsync<T>(source: string, params: SQLiteBindParams): AsyncIterableIterator<T>;\n /**\n * @hidden\n */\n public getEachAsync<T>(\n source: string,\n ...params: SQLiteVariadicBindParams\n ): AsyncIterableIterator<T>;\n public async *getEachAsync<T>(source: string, ...params: any[]): AsyncIterableIterator<T> {\n const statement = await this.prepareAsync(source);\n try {\n const result = await statement.executeAsync<T>(...params);\n for await (const row of result) {\n yield row;\n }\n } finally {\n await statement.finalizeAsync();\n }\n }\n\n /**\n * A convenience wrapper around [`SQLiteDatabase.prepareAsync()`](#prepareasyncsource), [`SQLiteStatement.executeAsync()`](#executeasyncparams), [`SQLiteExecuteAsyncResult.getAllAsync()`](#getallasync), and [`SQLiteStatement.finalizeAsync()`](#finalizeasync).\n * @param source A string containing the SQL query.\n * @param params The parameters to bind to the prepared statement. You can pass values in array, object, or variadic arguments. See [`SQLiteBindValue`](#sqlitebindvalue) for more information about binding values.\n * @example\n * ```ts\n * // For unnamed parameters, you pass values in an array.\n * db.getAllAsync('SELECT * FROM test WHERE intValue = ? AND name = ?', [1, 'Hello']);\n *\n * // For unnamed parameters, you pass values in variadic arguments.\n * db.getAllAsync('SELECT * FROM test WHERE intValue = ? AND name = ?', 1, 'Hello');\n *\n * // For named parameters, you should pass values in object.\n * db.getAllAsync('SELECT * FROM test WHERE intValue = $intValue AND name = $name', { $intValue: 1, $name: 'Hello' });\n * ```\n */\n public getAllAsync<T>(source: string, params: SQLiteBindParams): Promise<T[]>;\n /**\n * @hidden\n */\n public getAllAsync<T>(source: string, ...params: SQLiteVariadicBindParams): Promise<T[]>;\n public async getAllAsync<T>(source: string, ...params: any[]): Promise<T[]> {\n const statement = await this.prepareAsync(source);\n let allRows;\n try {\n const result = await statement.executeAsync<T>(...params);\n allRows = await result.getAllAsync();\n } finally {\n await statement.finalizeAsync();\n }\n return allRows;\n }\n\n /**\n * A convenience wrapper around [`SQLiteDatabase.prepareSync()`](#preparesyncsource), [`SQLiteStatement.executeSync()`](#executesyncparams), and [`SQLiteStatement.finalizeSync()`](#finalizesync).\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n * @param source A string containing the SQL query.\n * @param params The parameters to bind to the prepared statement. You can pass values in array, object, or variadic arguments. See [`SQLiteBindValue`](#sqlitebindvalue) for more information about binding values.\n */\n public runSync(source: string, params: SQLiteBindParams): SQLiteRunResult;\n /**\n * @hidden\n */\n public runSync(source: string, ...params: SQLiteVariadicBindParams): SQLiteRunResult;\n public runSync(source: string, ...params: any[]): SQLiteRunResult {\n const statement = this.prepareSync(source);\n let result: SQLiteExecuteSyncResult<unknown>;\n try {\n result = statement.executeSync(...params);\n } finally {\n statement.finalizeSync();\n }\n return result;\n }\n\n /**\n * A convenience wrapper around [`SQLiteDatabase.prepareSync()`](#preparesyncsource), [`SQLiteStatement.executeSync()`](#executesyncparams), [`SQLiteExecuteSyncResult.getFirstSync()`](#getfirstsync), and [`SQLiteStatement.finalizeSync()`](#finalizesync).\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n * @param source A string containing the SQL query.\n * @param params The parameters to bind to the prepared statement. You can pass values in array, object, or variadic arguments. See [`SQLiteBindValue`](#sqlitebindvalue) for more information about binding values.\n */\n public getFirstSync<T>(source: string, params: SQLiteBindParams): T | null;\n /**\n * @hidden\n */\n public getFirstSync<T>(source: string, ...params: SQLiteVariadicBindParams): T | null;\n public getFirstSync<T>(source: string, ...params: any[]): T | null {\n const statement = this.prepareSync(source);\n let firstRow: T | null;\n try {\n const result = statement.executeSync<T>(...params);\n firstRow = result.getFirstSync();\n } finally {\n statement.finalizeSync();\n }\n return firstRow;\n }\n\n /**\n * A convenience wrapper around [`SQLiteDatabase.prepareSync()`](#preparesyncsource), [`SQLiteStatement.executeSync()`](#executesyncparams), [`SQLiteExecuteSyncResult`](#sqliteexecutesyncresult) `Iterator`, and [`SQLiteStatement.finalizeSync()`](#finalizesync).\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n * @param source A string containing the SQL query.\n * @param params The parameters to bind to the prepared statement. You can pass values in array, object, or variadic arguments. See [`SQLiteBindValue`](#sqlitebindvalue) for more information about binding values.\n * @returns This function returns an [`IterableIterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator). You can use `for...of` to iterate over the rows from the SQLite query result.\n */\n public getEachSync<T>(source: string, params: SQLiteBindParams): IterableIterator<T>;\n /**\n * @hidden\n */\n public getEachSync<T>(source: string, ...params: SQLiteVariadicBindParams): IterableIterator<T>;\n public *getEachSync<T>(source: string, ...params: any[]): IterableIterator<T> {\n const statement = this.prepareSync(source);\n try {\n const result = statement.executeSync<T>(...params);\n for (const row of result) {\n yield row;\n }\n } finally {\n statement.finalizeSync();\n }\n }\n\n /**\n * A convenience wrapper around [`SQLiteDatabase.prepareSync()`](#preparesyncsource), [`SQLiteStatement.executeSync()`](#executesyncparams), [`SQLiteExecuteSyncResult.getAllSync()`](#getallsync), and [`SQLiteStatement.finalizeSync()`](#finalizesync).\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n * @param source A string containing the SQL query.\n * @param params The parameters to bind to the prepared statement. You can pass values in array, object, or variadic arguments. See [`SQLiteBindValue`](#sqlitebindvalue) for more information about binding values.\n */\n public getAllSync<T>(source: string, params: SQLiteBindParams): T[];\n /**\n * @hidden\n */\n public getAllSync<T>(source: string, ...params: SQLiteVariadicBindParams): T[];\n public getAllSync<T>(source: string, ...params: any[]): T[] {\n const statement = this.prepareSync(source);\n let allRows;\n try {\n const result = statement.executeSync<T>(...params);\n allRows = result.getAllSync();\n } finally {\n statement.finalizeSync();\n }\n return allRows;\n }\n\n /**\n * Synchronize the local database with the remote libSQL server.\n * This method is only available from libSQL integration.\n */\n public syncLibSQL(): Promise<void> {\n if (typeof this.nativeDatabase.syncLibSQL !== 'function') {\n throw new Error('syncLibSQL is not supported in the current environment');\n }\n return this.nativeDatabase.syncLibSQL();\n }\n\n //#endregion\n}\n\n/**\n * The default directory for SQLite databases.\n */\nexport const defaultDatabaseDirectory = ExpoSQLite.defaultDatabaseDirectory;\n\n/**\n * Open a database.\n *\n * @param databaseName The name of the database file to open.\n * @param options Open options.\n * @param directory The directory where the database file is located. The default value is `defaultDatabaseDirectory`. This parameter is not supported on web.\n */\nexport async function openDatabaseAsync(\n databaseName: string,\n options?: SQLiteOpenOptions,\n directory?: string\n): Promise<SQLiteDatabase> {\n const openOptions = options ?? {};\n const databasePath = createDatabasePath(databaseName, directory);\n await ExpoSQLite.ensureDatabasePathExistsAsync(databasePath);\n const nativeDatabase = new ExpoSQLite.NativeDatabase(\n databasePath,\n flattenOpenOptions(openOptions)\n );\n await nativeDatabase.initAsync();\n return new SQLiteDatabase(databasePath, openOptions, nativeDatabase);\n}\n\n/**\n * Open a database.\n *\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n *\n * @param databaseName The name of the database file to open.\n * @param options Open options.\n * @param directory The directory where the database file is located. The default value is `defaultDatabaseDirectory`. This parameter is not supported on web.\n */\nexport function openDatabaseSync(\n databaseName: string,\n options?: SQLiteOpenOptions,\n directory?: string\n): SQLiteDatabase {\n const openOptions = options ?? {};\n const databasePath = createDatabasePath(databaseName, directory);\n ExpoSQLite.ensureDatabasePathExistsSync(databasePath);\n const nativeDatabase = new ExpoSQLite.NativeDatabase(\n databasePath,\n flattenOpenOptions(openOptions)\n );\n nativeDatabase.initSync();\n return new SQLiteDatabase(databasePath, openOptions, nativeDatabase);\n}\n\n/**\n * Given a `Uint8Array` data and [deserialize to memory database](https://sqlite.org/c3ref/deserialize.html).\n *\n * @param serializedData The binary array to deserialize from [`SQLiteDatabase.serializeAsync()`](#serializeasyncdatabasename).\n * @param options Open options.\n */\nexport async function deserializeDatabaseAsync(\n serializedData: Uint8Array,\n options?: SQLiteOpenOptions\n): Promise<SQLiteDatabase> {\n const openOptions = options ?? {};\n const nativeDatabase = new ExpoSQLite.NativeDatabase(\n ':memory:',\n flattenOpenOptions(openOptions),\n serializedData\n );\n await nativeDatabase.initAsync();\n return new SQLiteDatabase(':memory:', openOptions, nativeDatabase);\n}\n\n/**\n * Given a `Uint8Array` data and [deserialize to memory database](https://sqlite.org/c3ref/deserialize.html).\n *\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n *\n * @param serializedData The binary array to deserialize from [`SQLiteDatabase.serializeSync()`](#serializesyncdatabasename)\n * @param options Open options.\n */\nexport function deserializeDatabaseSync(\n serializedData: Uint8Array,\n options?: SQLiteOpenOptions\n): SQLiteDatabase {\n const openOptions = options ?? {};\n const nativeDatabase = new ExpoSQLite.NativeDatabase(\n ':memory:',\n flattenOpenOptions(openOptions),\n serializedData\n );\n nativeDatabase.initSync();\n return new SQLiteDatabase(':memory:', openOptions, nativeDatabase);\n}\n\n/**\n * Delete a database file.\n *\n * @param databaseName The name of the database file to delete.\n * @param directory The directory where the database file is located. The default value is `defaultDatabaseDirectory`.\n */\nexport async function deleteDatabaseAsync(databaseName: string, directory?: string): Promise<void> {\n const databasePath = createDatabasePath(databaseName, directory);\n return await ExpoSQLite.deleteDatabaseAsync(databasePath);\n}\n\n/**\n * Delete a database file.\n *\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n *\n * @param databaseName The name of the database file to delete.\n * @param directory The directory where the database file is located. The default value is `defaultDatabaseDirectory`.\n */\nexport function deleteDatabaseSync(databaseName: string, directory?: string): void {\n const databasePath = createDatabasePath(databaseName, directory);\n return ExpoSQLite.deleteDatabaseSync(databasePath);\n}\n\n/**\n * Backup a database to another database.\n *\n * @see https://www.sqlite.org/c3ref/backup_finish.html\n *\n * @param options - The backup options\n * @param options.sourceDatabase - The source database to backup from\n * @param options.sourceDatabaseName - The name of the source database. The default value is `main`\n * @param options.destDatabase - The destination database to backup to\n * @param options.destDatabaseName - The name of the destination database. The default value is `m\n */\nexport function backupDatabaseAsync({\n sourceDatabase,\n sourceDatabaseName,\n destDatabase,\n destDatabaseName,\n}: {\n sourceDatabase: SQLiteDatabase;\n sourceDatabaseName?: string;\n destDatabase: SQLiteDatabase;\n destDatabaseName?: string;\n}): Promise<void> {\n return ExpoSQLite.backupDatabaseAsync(\n destDatabase.nativeDatabase,\n destDatabaseName ?? 'main',\n sourceDatabase.nativeDatabase,\n sourceDatabaseName ?? 'main'\n );\n}\n\n/**\n * Backup a database to another database.\n *\n * @see https://www.sqlite.org/c3ref/backup_finish.html\n *\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n *\n * @param options - The backup options\n * @param options.sourceDatabase - The source database to backup from\n * @param options.sourceDatabaseName - The name of the source database. The default value is `main`\n * @param options.destDatabase - The destination database to backup to\n * @param options.destDatabaseName - The name of the destination database. The default value is `m\n */\nexport function backupDatabaseSync({\n sourceDatabase,\n sourceDatabaseName,\n destDatabase,\n destDatabaseName,\n}: {\n sourceDatabase: SQLiteDatabase;\n sourceDatabaseName?: string;\n destDatabase: SQLiteDatabase;\n destDatabaseName?: string;\n}): void {\n return ExpoSQLite.backupDatabaseSync(\n destDatabase.nativeDatabase,\n destDatabaseName ?? 'main',\n sourceDatabase.nativeDatabase,\n sourceDatabaseName ?? 'main'\n );\n}\n\n/**\n * The event payload for the listener of [`addDatabaseChangeListener`](#sqliteadddatabasechangelistenerlistener)\n */\nexport type DatabaseChangeEvent = {\n /** The database name. The value would be `main` by default and other database names if you use `ATTACH DATABASE` statement. */\n databaseName: string;\n\n /** The absolute file path to the database. */\n databaseFilePath: string;\n\n /** The table name. */\n tableName: string;\n\n /** The changed row ID. */\n rowId: number;\n};\n\n/**\n * Add a listener for database changes.\n * > Note: to enable this feature, you must set [`enableChangeListener` to `true`](#sqliteopenoptions) when opening the database.\n *\n * @param listener A function that receives the `databaseName`, `databaseFilePath`, `tableName` and `rowId` of the modified data.\n * @returns A `Subscription` object that you can call `remove()` on when you would like to unsubscribe the listener.\n */\nexport function addDatabaseChangeListener(\n listener: (event: DatabaseChangeEvent) => void\n): EventSubscription {\n return ExpoSQLite.addListener('onDatabaseChange', listener);\n}\n\n/**\n * A new connection specific used for [`withExclusiveTransactionAsync`](#withexclusivetransactionasynctask).\n * @hidden not going to pull all the database methods to the document.\n */\nclass Transaction extends SQLiteDatabase {\n public static async createAsync(db: SQLiteDatabase): Promise<Transaction> {\n const options = { ...db.options, useNewConnection: true };\n const nativeDatabase = new ExpoSQLite.NativeDatabase(\n db.databasePath,\n flattenOpenOptions(options)\n );\n await nativeDatabase.initAsync();\n return new Transaction(db.databasePath, options, nativeDatabase);\n }\n}\n"]}
1
+ {"version":3,"file":"SQLiteDatabase.js","sourceRoot":"","sources":["../src/SQLiteDatabase.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAqC,MAAM,kBAAkB,CAAC;AACzF,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAKL,eAAe,GAEhB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAIjD;;GAEG;AACH,MAAM,OAAO,cAAc;IAEP;IACA;IACA;IAHlB,YACkB,YAAoB,EACpB,OAA0B,EAC1B,cAA8B;QAF9B,iBAAY,GAAZ,YAAY,CAAQ;QACpB,YAAO,GAAP,OAAO,CAAmB;QAC1B,mBAAc,GAAd,cAAc,CAAgB;IAC7C,CAAC;IAEJ;;OAEG;IACI,oBAAoB;QACzB,OAAO,IAAI,CAAC,cAAc,CAAC,oBAAoB,EAAE,CAAC;IACpD,CAAC;IAED;;OAEG;IACI,UAAU;QACf,OAAO,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC;IAC1C,CAAC;IAED;;;;;OAKG;IACI,SAAS,CAAC,MAAc;QAC7B,OAAO,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAC/C,CAAC;IAED;;;;OAIG;IACI,cAAc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C,EAClC,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,gBAAgB,GAMjB;IACC,OAAO,UAAU,CAAC,mBAAmB,CACnC,YAAY,CAAC,cAAc,EAC3B,gBAAgB,IAAI,MAAM,EAC1B,cAAc,CAAC,cAAc,EAC7B,kBAAkB,IAAI,MAAM,CAC7B,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,kBAAkB,CAAC,EACjC,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,gBAAgB,GAMjB;IACC,OAAO,UAAU,CAAC,kBAAkB,CAClC,YAAY,CAAC,cAAc,EAC3B,gBAAgB,IAAI,MAAM,EAC1B,cAAc,CAAC,cAAc,EAC7B,kBAAkB,IAAI,MAAM,CAC7B,CAAC;AACJ,CAAC;AAmBD;;;;;;GAMG;AACH,MAAM,UAAU,yBAAyB,CACvC,QAA8C;IAE9C,OAAO,UAAU,CAAC,WAAW,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC;AAC9D,CAAC;AAED;;;GAGG;AACH,MAAM,WAAY,SAAQ,cAAc;IAC/B,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,EAAkB;QAChD,MAAM,OAAO,GAAG,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC;QAC1D,MAAM,cAAc,GAAG,IAAI,UAAU,CAAC,cAAc,CAClD,EAAE,CAAC,YAAY,EACf,kBAAkB,CAAC,OAAO,CAAC,CAC5B,CAAC;QACF,MAAM,cAAc,CAAC,SAAS,EAAE,CAAC;QACjC,OAAO,IAAI,WAAW,CAAC,EAAE,CAAC,YAAY,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;IACnE,CAAC;CACF","sourcesContent":["import { type EventSubscription } from 'expo-modules-core';\nimport { Platform } from 'react-native';\n\nimport ExpoSQLite from './ExpoSQLite';\nimport { flattenOpenOptions, NativeDatabase, SQLiteOpenOptions } from './NativeDatabase';\nimport { SQLiteSession } from './SQLiteSession';\nimport {\n SQLiteBindParams,\n SQLiteExecuteAsyncResult,\n SQLiteExecuteSyncResult,\n SQLiteRunResult,\n SQLiteStatement,\n SQLiteVariadicBindParams,\n} from './SQLiteStatement';\nimport { createDatabasePath } from './pathUtils';\n\nexport { SQLiteOpenOptions };\n\n/**\n * A SQLite database.\n */\nexport class SQLiteDatabase {\n constructor(\n public readonly databasePath: string,\n public readonly options: SQLiteOpenOptions,\n public readonly nativeDatabase: NativeDatabase\n ) {}\n\n /**\n * Asynchronous call to return whether the database is currently in a transaction.\n */\n public isInTransactionAsync(): Promise<boolean> {\n return this.nativeDatabase.isInTransactionAsync();\n }\n\n /**\n * Close the database.\n */\n public closeAsync(): Promise<void> {\n return this.nativeDatabase.closeAsync();\n }\n\n /**\n * Execute all SQL queries in the supplied string.\n * > Note: The queries are not escaped for you! Be careful when constructing your queries.\n *\n * @param source A string containing all the SQL queries.\n */\n public execAsync(source: string): Promise<void> {\n return this.nativeDatabase.execAsync(source);\n }\n\n /**\n * [Serialize the database](https://sqlite.org/c3ref/serialize.html) as `Uint8Array`.\n *\n * @param databaseName The name of the current attached databases. The default value is `main` which is the default database name.\n */\n public serializeAsync(databaseName: string = 'main'): Promise<Uint8Array> {\n return this.nativeDatabase.serializeAsync(databaseName);\n }\n\n /**\n * Create a [prepared SQLite statement](https://www.sqlite.org/c3ref/prepare.html).\n *\n * @param source A string containing the SQL query.\n */\n public async prepareAsync(source: string): Promise<SQLiteStatement> {\n const nativeStatement = new ExpoSQLite.NativeStatement();\n await this.nativeDatabase.prepareAsync(nativeStatement, source);\n return new SQLiteStatement(this.nativeDatabase, nativeStatement);\n }\n\n /**\n * Create a new session for the database.\n * @see [`sqlite3session_create`](https://www.sqlite.org/session/sqlite3session_create.html)\n * @param dbName The name of the database to create a session for. The default value is `main`.\n */\n public async createSessionAsync(dbName: string = 'main'): Promise<SQLiteSession> {\n const nativeSession = new ExpoSQLite.NativeSession();\n await this.nativeDatabase.createSessionAsync(nativeSession, dbName);\n return new SQLiteSession(this.nativeDatabase, nativeSession);\n }\n\n /**\n * Execute a transaction and automatically commit/rollback based on the `task` result.\n *\n * > **Note:** This transaction is not exclusive and can be interrupted by other async queries.\n *\n * @example\n * ```ts\n * db.withTransactionAsync(async () => {\n * await db.execAsync('UPDATE test SET name = \"aaa\"');\n *\n * //\n * // We cannot control the order of async/await order, so order of execution is not guaranteed.\n * // The following UPDATE query out of transaction may be executed here and break the expectation.\n * //\n *\n * const result = await db.getFirstAsync<{ name: string }>('SELECT name FROM Users');\n * expect(result?.name).toBe('aaa');\n * });\n * db.execAsync('UPDATE test SET name = \"bbb\"');\n * ```\n * If you worry about the order of execution, use `withExclusiveTransactionAsync` instead.\n *\n * @param task An async function to execute within a transaction.\n */\n public async withTransactionAsync(task: () => Promise<void>): Promise<void> {\n try {\n await this.execAsync('BEGIN');\n await task();\n await this.execAsync('COMMIT');\n } catch (e) {\n await this.execAsync('ROLLBACK');\n throw e;\n }\n }\n\n /**\n * Execute a transaction and automatically commit/rollback based on the `task` result.\n *\n * The transaction may be exclusive.\n * As long as the transaction is converted into a write transaction,\n * the other async write queries will abort with `database is locked` error.\n *\n * > **Note:** This function is not supported on web.\n *\n * @param task An async function to execute within a transaction. Any queries inside the transaction must be executed on the `txn` object.\n * The `txn` object has the same interfaces as the [`SQLiteDatabase`](#sqlitedatabase) object. You can use `txn` like a [`SQLiteDatabase`](#sqlitedatabase) object.\n *\n * @platform android\n * @platform ios\n * @platform macos\n *\n * @example\n * ```ts\n * db.withExclusiveTransactionAsync(async (txn) => {\n * await txn.execAsync('UPDATE test SET name = \"aaa\"');\n * });\n * ```\n */\n public async withExclusiveTransactionAsync(\n task: (txn: Transaction) => Promise<void>\n ): Promise<void> {\n if (Platform.OS === 'web') {\n throw new Error('withExclusiveTransactionAsync is not supported on web');\n }\n const transaction = await Transaction.createAsync(this);\n let error;\n try {\n await transaction.execAsync('BEGIN');\n await task(transaction);\n await transaction.execAsync('COMMIT');\n } catch (e) {\n await transaction.execAsync('ROLLBACK');\n error = e;\n } finally {\n await transaction.closeAsync();\n }\n if (error) {\n throw error;\n }\n }\n\n /**\n * Synchronous call to return whether the database is currently in a transaction.\n */\n public isInTransactionSync(): boolean {\n return this.nativeDatabase.isInTransactionSync();\n }\n\n /**\n * Close the database.\n */\n public closeSync(): void {\n return this.nativeDatabase.closeSync();\n }\n\n /**\n * Execute all SQL queries in the supplied string.\n *\n * > **Note:** The queries are not escaped for you! Be careful when constructing your queries.\n *\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n *\n * @param source A string containing all the SQL queries.\n */\n public execSync(source: string): void {\n return this.nativeDatabase.execSync(source);\n }\n\n /**\n * [Serialize the database](https://sqlite.org/c3ref/serialize.html) as `Uint8Array`.\n *\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n *\n * @param databaseName The name of the current attached databases. The default value is `main` which is the default database name.\n */\n public serializeSync(databaseName: string = 'main'): Uint8Array {\n return this.nativeDatabase.serializeSync(databaseName);\n }\n\n /**\n * Create a [prepared SQLite statement](https://www.sqlite.org/c3ref/prepare.html).\n *\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n *\n * @param source A string containing the SQL query.\n */\n public prepareSync(source: string): SQLiteStatement {\n const nativeStatement = new ExpoSQLite.NativeStatement();\n this.nativeDatabase.prepareSync(nativeStatement, source);\n return new SQLiteStatement(this.nativeDatabase, nativeStatement);\n }\n\n /**\n * Create a new session for the database.\n *\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n *\n * @see [`sqlite3session_create`](https://www.sqlite.org/session/sqlite3session_create.html)\n * @param dbName The name of the database to create a session for. The default value is `main`.\n */\n public createSessionSync(dbName: string = 'main'): SQLiteSession {\n const nativeSession = new ExpoSQLite.NativeSession();\n this.nativeDatabase.createSessionSync(nativeSession, dbName);\n return new SQLiteSession(this.nativeDatabase, nativeSession);\n }\n\n /**\n * Execute a transaction and automatically commit/rollback based on the `task` result.\n *\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n *\n * @param task An async function to execute within a transaction.\n */\n public withTransactionSync(task: () => void): void {\n try {\n this.execSync('BEGIN');\n task();\n this.execSync('COMMIT');\n } catch (e) {\n this.execSync('ROLLBACK');\n throw e;\n }\n }\n\n //#region Statement API shorthands\n\n /**\n * A convenience wrapper around [`SQLiteDatabase.prepareAsync()`](#prepareasyncsource), [`SQLiteStatement.executeAsync()`](#executeasyncparams), and [`SQLiteStatement.finalizeAsync()`](#finalizeasync).\n * @param source A string containing the SQL query.\n * @param params The parameters to bind to the prepared statement. You can pass values in array, object, or variadic arguments. See [`SQLiteBindValue`](#sqlitebindvalue) for more information about binding values.\n */\n public runAsync(source: string, params: SQLiteBindParams): Promise<SQLiteRunResult>;\n\n /**\n * @hidden\n */\n public runAsync(source: string, ...params: SQLiteVariadicBindParams): Promise<SQLiteRunResult>;\n public async runAsync(source: string, ...params: any[]): Promise<SQLiteRunResult> {\n const statement = await this.prepareAsync(source);\n let result: SQLiteExecuteAsyncResult<unknown>;\n try {\n result = await statement.executeAsync(...params);\n } finally {\n await statement.finalizeAsync();\n }\n return result;\n }\n\n /**\n * A convenience wrapper around [`SQLiteDatabase.prepareAsync()`](#prepareasyncsource), [`SQLiteStatement.executeAsync()`](#executeasyncparams), [`SQLiteExecuteAsyncResult.getFirstAsync()`](#getfirstasync), and [`SQLiteStatement.finalizeAsync()`](#finalizeasync).\n * @param source A string containing the SQL query.\n * @param params The parameters to bind to the prepared statement. You can pass values in array, object, or variadic arguments. See [`SQLiteBindValue`](#sqlitebindvalue) for more information about binding values.\n */\n public getFirstAsync<T>(source: string, params: SQLiteBindParams): Promise<T | null>;\n /**\n * @hidden\n */\n public getFirstAsync<T>(source: string, ...params: SQLiteVariadicBindParams): Promise<T | null>;\n public async getFirstAsync<T>(source: string, ...params: any[]): Promise<T | null> {\n const statement = await this.prepareAsync(source);\n let firstRow: T | null;\n try {\n const result = await statement.executeAsync<T>(...params);\n firstRow = await result.getFirstAsync();\n } finally {\n await statement.finalizeAsync();\n }\n return firstRow;\n }\n\n /**\n * A convenience wrapper around [`SQLiteDatabase.prepareAsync()`](#prepareasyncsource), [`SQLiteStatement.executeAsync()`](#executeasyncparams), [`SQLiteExecuteAsyncResult`](#sqliteexecuteasyncresult) `AsyncIterator`, and [`SQLiteStatement.finalizeAsync()`](#finalizeasync).\n * @param source A string containing the SQL query.\n * @param params The parameters to bind to the prepared statement. You can pass values in array, object, or variadic arguments. See [`SQLiteBindValue`](#sqlitebindvalue) for more information about binding values.\n * @returns Rather than returning Promise, this function returns an [`AsyncIterableIterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AsyncIterator). You can use `for await...of` to iterate over the rows from the SQLite query result.\n */\n public getEachAsync<T>(source: string, params: SQLiteBindParams): AsyncIterableIterator<T>;\n /**\n * @hidden\n */\n public getEachAsync<T>(\n source: string,\n ...params: SQLiteVariadicBindParams\n ): AsyncIterableIterator<T>;\n public async *getEachAsync<T>(source: string, ...params: any[]): AsyncIterableIterator<T> {\n const statement = await this.prepareAsync(source);\n try {\n const result = await statement.executeAsync<T>(...params);\n for await (const row of result) {\n yield row;\n }\n } finally {\n await statement.finalizeAsync();\n }\n }\n\n /**\n * A convenience wrapper around [`SQLiteDatabase.prepareAsync()`](#prepareasyncsource), [`SQLiteStatement.executeAsync()`](#executeasyncparams), [`SQLiteExecuteAsyncResult.getAllAsync()`](#getallasync), and [`SQLiteStatement.finalizeAsync()`](#finalizeasync).\n * @param source A string containing the SQL query.\n * @param params The parameters to bind to the prepared statement. You can pass values in array, object, or variadic arguments. See [`SQLiteBindValue`](#sqlitebindvalue) for more information about binding values.\n * @example\n * ```ts\n * // For unnamed parameters, you pass values in an array.\n * db.getAllAsync('SELECT * FROM test WHERE intValue = ? AND name = ?', [1, 'Hello']);\n *\n * // For unnamed parameters, you pass values in variadic arguments.\n * db.getAllAsync('SELECT * FROM test WHERE intValue = ? AND name = ?', 1, 'Hello');\n *\n * // For named parameters, you should pass values in object.\n * db.getAllAsync('SELECT * FROM test WHERE intValue = $intValue AND name = $name', { $intValue: 1, $name: 'Hello' });\n * ```\n */\n public getAllAsync<T>(source: string, params: SQLiteBindParams): Promise<T[]>;\n /**\n * @hidden\n */\n public getAllAsync<T>(source: string, ...params: SQLiteVariadicBindParams): Promise<T[]>;\n public async getAllAsync<T>(source: string, ...params: any[]): Promise<T[]> {\n const statement = await this.prepareAsync(source);\n let allRows;\n try {\n const result = await statement.executeAsync<T>(...params);\n allRows = await result.getAllAsync();\n } finally {\n await statement.finalizeAsync();\n }\n return allRows;\n }\n\n /**\n * A convenience wrapper around [`SQLiteDatabase.prepareSync()`](#preparesyncsource), [`SQLiteStatement.executeSync()`](#executesyncparams), and [`SQLiteStatement.finalizeSync()`](#finalizesync).\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n * @param source A string containing the SQL query.\n * @param params The parameters to bind to the prepared statement. You can pass values in array, object, or variadic arguments. See [`SQLiteBindValue`](#sqlitebindvalue) for more information about binding values.\n */\n public runSync(source: string, params: SQLiteBindParams): SQLiteRunResult;\n /**\n * @hidden\n */\n public runSync(source: string, ...params: SQLiteVariadicBindParams): SQLiteRunResult;\n public runSync(source: string, ...params: any[]): SQLiteRunResult {\n const statement = this.prepareSync(source);\n let result: SQLiteExecuteSyncResult<unknown>;\n try {\n result = statement.executeSync(...params);\n } finally {\n statement.finalizeSync();\n }\n return result;\n }\n\n /**\n * A convenience wrapper around [`SQLiteDatabase.prepareSync()`](#preparesyncsource), [`SQLiteStatement.executeSync()`](#executesyncparams), [`SQLiteExecuteSyncResult.getFirstSync()`](#getfirstsync), and [`SQLiteStatement.finalizeSync()`](#finalizesync).\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n * @param source A string containing the SQL query.\n * @param params The parameters to bind to the prepared statement. You can pass values in array, object, or variadic arguments. See [`SQLiteBindValue`](#sqlitebindvalue) for more information about binding values.\n */\n public getFirstSync<T>(source: string, params: SQLiteBindParams): T | null;\n /**\n * @hidden\n */\n public getFirstSync<T>(source: string, ...params: SQLiteVariadicBindParams): T | null;\n public getFirstSync<T>(source: string, ...params: any[]): T | null {\n const statement = this.prepareSync(source);\n let firstRow: T | null;\n try {\n const result = statement.executeSync<T>(...params);\n firstRow = result.getFirstSync();\n } finally {\n statement.finalizeSync();\n }\n return firstRow;\n }\n\n /**\n * A convenience wrapper around [`SQLiteDatabase.prepareSync()`](#preparesyncsource), [`SQLiteStatement.executeSync()`](#executesyncparams), [`SQLiteExecuteSyncResult`](#sqliteexecutesyncresult) `Iterator`, and [`SQLiteStatement.finalizeSync()`](#finalizesync).\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n * @param source A string containing the SQL query.\n * @param params The parameters to bind to the prepared statement. You can pass values in array, object, or variadic arguments. See [`SQLiteBindValue`](#sqlitebindvalue) for more information about binding values.\n * @returns This function returns an [`IterableIterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator). You can use `for...of` to iterate over the rows from the SQLite query result.\n */\n public getEachSync<T>(source: string, params: SQLiteBindParams): IterableIterator<T>;\n /**\n * @hidden\n */\n public getEachSync<T>(source: string, ...params: SQLiteVariadicBindParams): IterableIterator<T>;\n public *getEachSync<T>(source: string, ...params: any[]): IterableIterator<T> {\n const statement = this.prepareSync(source);\n try {\n const result = statement.executeSync<T>(...params);\n for (const row of result) {\n yield row;\n }\n } finally {\n statement.finalizeSync();\n }\n }\n\n /**\n * A convenience wrapper around [`SQLiteDatabase.prepareSync()`](#preparesyncsource), [`SQLiteStatement.executeSync()`](#executesyncparams), [`SQLiteExecuteSyncResult.getAllSync()`](#getallsync), and [`SQLiteStatement.finalizeSync()`](#finalizesync).\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n * @param source A string containing the SQL query.\n * @param params The parameters to bind to the prepared statement. You can pass values in array, object, or variadic arguments. See [`SQLiteBindValue`](#sqlitebindvalue) for more information about binding values.\n */\n public getAllSync<T>(source: string, params: SQLiteBindParams): T[];\n /**\n * @hidden\n */\n public getAllSync<T>(source: string, ...params: SQLiteVariadicBindParams): T[];\n public getAllSync<T>(source: string, ...params: any[]): T[] {\n const statement = this.prepareSync(source);\n let allRows;\n try {\n const result = statement.executeSync<T>(...params);\n allRows = result.getAllSync();\n } finally {\n statement.finalizeSync();\n }\n return allRows;\n }\n\n /**\n * Synchronize the local database with the remote libSQL server.\n * This method is only available from libSQL integration.\n */\n public syncLibSQL(): Promise<void> {\n if (typeof this.nativeDatabase.syncLibSQL !== 'function') {\n throw new Error('syncLibSQL is not supported in the current environment');\n }\n return this.nativeDatabase.syncLibSQL();\n }\n\n //#endregion\n}\n\n/**\n * The default directory for SQLite databases.\n */\nexport const defaultDatabaseDirectory = ExpoSQLite.defaultDatabaseDirectory;\n\n/**\n * Open a database.\n *\n * @param databaseName The name of the database file to open.\n * @param options Open options.\n * @param directory The directory where the database file is located. The default value is `defaultDatabaseDirectory`. This parameter is not supported on web.\n */\nexport async function openDatabaseAsync(\n databaseName: string,\n options?: SQLiteOpenOptions,\n directory?: string\n): Promise<SQLiteDatabase> {\n const openOptions = options ?? {};\n const databasePath = createDatabasePath(databaseName, directory);\n await ExpoSQLite.ensureDatabasePathExistsAsync(databasePath);\n const nativeDatabase = new ExpoSQLite.NativeDatabase(\n databasePath,\n flattenOpenOptions(openOptions)\n );\n await nativeDatabase.initAsync();\n return new SQLiteDatabase(databasePath, openOptions, nativeDatabase);\n}\n\n/**\n * Open a database.\n *\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n *\n * @param databaseName The name of the database file to open.\n * @param options Open options.\n * @param directory The directory where the database file is located. The default value is `defaultDatabaseDirectory`. This parameter is not supported on web.\n */\nexport function openDatabaseSync(\n databaseName: string,\n options?: SQLiteOpenOptions,\n directory?: string\n): SQLiteDatabase {\n const openOptions = options ?? {};\n const databasePath = createDatabasePath(databaseName, directory);\n ExpoSQLite.ensureDatabasePathExistsSync(databasePath);\n const nativeDatabase = new ExpoSQLite.NativeDatabase(\n databasePath,\n flattenOpenOptions(openOptions)\n );\n nativeDatabase.initSync();\n return new SQLiteDatabase(databasePath, openOptions, nativeDatabase);\n}\n\n/**\n * Given a `Uint8Array` data and [deserialize to memory database](https://sqlite.org/c3ref/deserialize.html).\n *\n * @param serializedData The binary array to deserialize from [`SQLiteDatabase.serializeAsync()`](#serializeasyncdatabasename).\n * @param options Open options.\n */\nexport async function deserializeDatabaseAsync(\n serializedData: Uint8Array,\n options?: SQLiteOpenOptions\n): Promise<SQLiteDatabase> {\n const openOptions = options ?? {};\n const nativeDatabase = new ExpoSQLite.NativeDatabase(\n ':memory:',\n flattenOpenOptions(openOptions),\n serializedData\n );\n await nativeDatabase.initAsync();\n return new SQLiteDatabase(':memory:', openOptions, nativeDatabase);\n}\n\n/**\n * Given a `Uint8Array` data and [deserialize to memory database](https://sqlite.org/c3ref/deserialize.html).\n *\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n *\n * @param serializedData The binary array to deserialize from [`SQLiteDatabase.serializeSync()`](#serializesyncdatabasename)\n * @param options Open options.\n */\nexport function deserializeDatabaseSync(\n serializedData: Uint8Array,\n options?: SQLiteOpenOptions\n): SQLiteDatabase {\n const openOptions = options ?? {};\n const nativeDatabase = new ExpoSQLite.NativeDatabase(\n ':memory:',\n flattenOpenOptions(openOptions),\n serializedData\n );\n nativeDatabase.initSync();\n return new SQLiteDatabase(':memory:', openOptions, nativeDatabase);\n}\n\n/**\n * Delete a database file.\n *\n * @param databaseName The name of the database file to delete.\n * @param directory The directory where the database file is located. The default value is `defaultDatabaseDirectory`.\n */\nexport async function deleteDatabaseAsync(databaseName: string, directory?: string): Promise<void> {\n const databasePath = createDatabasePath(databaseName, directory);\n return await ExpoSQLite.deleteDatabaseAsync(databasePath);\n}\n\n/**\n * Delete a database file.\n *\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n *\n * @param databaseName The name of the database file to delete.\n * @param directory The directory where the database file is located. The default value is `defaultDatabaseDirectory`.\n */\nexport function deleteDatabaseSync(databaseName: string, directory?: string): void {\n const databasePath = createDatabasePath(databaseName, directory);\n return ExpoSQLite.deleteDatabaseSync(databasePath);\n}\n\n/**\n * Backup a database to another database.\n *\n * @see https://www.sqlite.org/c3ref/backup_finish.html\n *\n * @param options - The backup options\n * @param options.sourceDatabase - The source database to backup from\n * @param options.sourceDatabaseName - The name of the source database. The default value is `main`\n * @param options.destDatabase - The destination database to backup to\n * @param options.destDatabaseName - The name of the destination database. The default value is `m\n */\nexport function backupDatabaseAsync({\n sourceDatabase,\n sourceDatabaseName,\n destDatabase,\n destDatabaseName,\n}: {\n sourceDatabase: SQLiteDatabase;\n sourceDatabaseName?: string;\n destDatabase: SQLiteDatabase;\n destDatabaseName?: string;\n}): Promise<void> {\n return ExpoSQLite.backupDatabaseAsync(\n destDatabase.nativeDatabase,\n destDatabaseName ?? 'main',\n sourceDatabase.nativeDatabase,\n sourceDatabaseName ?? 'main'\n );\n}\n\n/**\n * Backup a database to another database.\n *\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n *\n * @see https://www.sqlite.org/c3ref/backup_finish.html\n *\n * @param options - The backup options\n * @param options.sourceDatabase - The source database to backup from\n * @param options.sourceDatabaseName - The name of the source database. The default value is `main`\n * @param options.destDatabase - The destination database to backup to\n * @param options.destDatabaseName - The name of the destination database. The default value is `m\n */\nexport function backupDatabaseSync({\n sourceDatabase,\n sourceDatabaseName,\n destDatabase,\n destDatabaseName,\n}: {\n sourceDatabase: SQLiteDatabase;\n sourceDatabaseName?: string;\n destDatabase: SQLiteDatabase;\n destDatabaseName?: string;\n}): void {\n return ExpoSQLite.backupDatabaseSync(\n destDatabase.nativeDatabase,\n destDatabaseName ?? 'main',\n sourceDatabase.nativeDatabase,\n sourceDatabaseName ?? 'main'\n );\n}\n\n/**\n * The event payload for the listener of [`addDatabaseChangeListener`](#sqliteadddatabasechangelistenerlistener)\n */\nexport type DatabaseChangeEvent = {\n /** The database name. The value would be `main` by default and other database names if you use `ATTACH DATABASE` statement. */\n databaseName: string;\n\n /** The absolute file path to the database. */\n databaseFilePath: string;\n\n /** The table name. */\n tableName: string;\n\n /** The changed row ID. */\n rowId: number;\n};\n\n/**\n * Add a listener for database changes.\n * > Note: to enable this feature, you must set [`enableChangeListener` to `true`](#sqliteopenoptions) when opening the database.\n *\n * @param listener A function that receives the `databaseName`, `databaseFilePath`, `tableName` and `rowId` of the modified data.\n * @returns A `Subscription` object that you can call `remove()` on when you would like to unsubscribe the listener.\n */\nexport function addDatabaseChangeListener(\n listener: (event: DatabaseChangeEvent) => void\n): EventSubscription {\n return ExpoSQLite.addListener('onDatabaseChange', listener);\n}\n\n/**\n * A new connection specific used for [`withExclusiveTransactionAsync`](#withexclusivetransactionasynctask).\n * @hidden not going to pull all the database methods to the document.\n */\nclass Transaction extends SQLiteDatabase {\n public static async createAsync(db: SQLiteDatabase): Promise<Transaction> {\n const options = { ...db.options, useNewConnection: true };\n const nativeDatabase = new ExpoSQLite.NativeDatabase(\n db.databasePath,\n flattenOpenOptions(options)\n );\n await nativeDatabase.initAsync();\n return new Transaction(db.databasePath, options, nativeDatabase);\n }\n}\n"]}
@@ -33,7 +33,7 @@ export declare class SQLiteSession {
33
33
  createChangesetAsync(): Promise<Changeset>;
34
34
  /**
35
35
  * Create an inverted changeset asynchronously.
36
- * This is a shorthand for [`createChangesetAsync()`](#createchangesetasync) + [`invertChangesetAsync()`](#invertchangesetasync).
36
+ * This is a shorthand for [`createChangesetAsync()`](#createchangesetasync) + [`invertChangesetAsync()`](#invertchangesetasyncchangeset).
37
37
  */
38
38
  createInvertedChangesetAsync(): Promise<Changeset>;
39
39
  /**
@@ -50,62 +50,61 @@ export declare class SQLiteSession {
50
50
  invertChangesetAsync(changeset: Changeset): Promise<Changeset>;
51
51
  /**
52
52
  * Attach a table to the session synchronously.
53
- * @see [`sqlite3session_attach`](https://www.sqlite.org/session/sqlite3session_attach.html)
54
53
  *
55
54
  * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.
56
55
  *
57
56
  * @param table The table to attach.
57
+ * @see [`sqlite3session_attach`](https://www.sqlite.org/session/sqlite3session_attach.html)
58
58
  */
59
59
  attachSync(table: string | null): void;
60
60
  /**
61
61
  * Enable or disable the session synchronously.
62
- * @see [`sqlite3session_enable`](https://www.sqlite.org/session/sqlite3session_enable.html)
63
62
  *
64
63
  * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.
65
64
  *
66
65
  * @param enabled Whether to enable or disable the session.
66
+ * @see [`sqlite3session_enable`](https://www.sqlite.org/session/sqlite3session_enable.html)
67
67
  */
68
68
  enableSync(enabled: boolean): void;
69
69
  /**
70
70
  * Close the session synchronously.
71
- * @see [`sqlite3session_delete`](https://www.sqlite.org/session/sqlite3session_delete.html)
72
71
  *
73
72
  * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.
74
73
  *
74
+ * @see [`sqlite3session_delete`](https://www.sqlite.org/session/sqlite3session_delete.html)
75
75
  */
76
76
  closeSync(): void;
77
77
  /**
78
78
  * Create a changeset synchronously.
79
- * @see [`sqlite3session_changeset`](https://www.sqlite.org/session/sqlite3session_changeset.html)
80
79
  *
81
80
  * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.
82
81
  *
82
+ * @see [`sqlite3session_changeset`](https://www.sqlite.org/session/sqlite3session_changeset.html)
83
83
  */
84
84
  createChangesetSync(): Changeset;
85
85
  /**
86
86
  * Create an inverted changeset synchronously.
87
- * This is a shorthand for [`createChangesetSync()`](#createchangesetsync) + [`invertChangesetSync()`](#invertchangesetsync).
87
+ * This is a shorthand for [`createChangesetSync()`](#createchangesetsync) + [`invertChangesetSync()`](#invertchangesetsyncchangeset).
88
88
  *
89
89
  * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.
90
- *
91
90
  */
92
91
  createInvertedChangesetSync(): Changeset;
93
92
  /**
94
93
  * Apply a changeset synchronously.
95
- * @see [`sqlite3changeset_apply`](https://www.sqlite.org/session/sqlite3changeset_apply.html)
96
94
  *
97
95
  * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.
98
96
  *
99
97
  * @param changeset The changeset to apply.
98
+ * @see [`sqlite3changeset_apply`](https://www.sqlite.org/session/sqlite3changeset_apply.html)
100
99
  */
101
100
  applyChangesetSync(changeset: Changeset): void;
102
101
  /**
103
102
  * Invert a changeset synchronously.
104
- * @see [`sqlite3changeset_invert`](https://www.sqlite.org/session/sqlite3changeset_invert.html)
105
103
  *
106
104
  * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.
107
105
  *
108
106
  * @param changeset The changeset to invert.
107
+ * @see [`sqlite3changeset_invert`](https://www.sqlite.org/session/sqlite3changeset_invert.html)
109
108
  */
110
109
  invertChangesetSync(changeset: Changeset): Changeset;
111
110
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SQLiteSession.d.ts","sourceRoot":"","sources":["../src/SQLiteSession.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEhE,OAAO,EAAE,KAAK,SAAS,EAAE,CAAC;AAE1B;;;GAGG;AACH,qBAAa,aAAa;IAEtB,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,aAAa;gBADb,cAAc,EAAE,cAAc,EAC9B,aAAa,EAAE,aAAa;IAK/C;;;;OAIG;IACI,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAIvD;;;;OAIG;IACI,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAInD;;;OAGG;IACI,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAIlC;;;OAGG;IACI,oBAAoB,IA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AO,GAAG,OAAO,CAAC,IAAI,CAAC;IAInD;;;OAGG;IACI,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAIlC;;;OAGG;IACI,oBAAoB,IAAI,OAAO,CAAC,SAAS,CAAC;IAIjD;;;OAGG;IACI,4BAA4B,IAAI,OAAO,CAAC,SAAS,CAAC;IAIzD;;;;OAIG;IACI,mBAAmB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAI/D;;;;OAIG;IACI,oBAAoB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IAQrE;;;;;;;OAOG;IACI,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAI7C;;;;;;;OAOG;IACI,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAIzC;;;;;;OAMG;IACI,SAAS,IAAI,IAAI;IAIxB;;;;;;OAMG;IACI,mBAAmB,IAAI,SAAS;IAIvC;;;;;OAKG;IACI,2BAA2B,IAAI,SAAS;IAI/C;;;;;;;OAOG;IACI,kBAAkB,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI;IAIrD;;;;;;;OAOG;IACI,mBAAmB,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS;CAK5D"}
@@ -42,7 +42,7 @@ export class SQLiteSession {
42
42
  }
43
43
  /**
44
44
  * Create an inverted changeset asynchronously.
45
- * This is a shorthand for [`createChangesetAsync()`](#createchangesetasync) + [`invertChangesetAsync()`](#invertchangesetasync).
45
+ * This is a shorthand for [`createChangesetAsync()`](#createchangesetasync) + [`invertChangesetAsync()`](#invertchangesetasyncchangeset).
46
46
  */
47
47
  createInvertedChangesetAsync() {
48
48
  return this.nativeSession.createInvertedChangesetAsync(this.nativeDatabase);
@@ -67,74 +67,73 @@ export class SQLiteSession {
67
67
  //#region Synchronous API
68
68
  /**
69
69
  * Attach a table to the session synchronously.
70
- * @see [`sqlite3session_attach`](https://www.sqlite.org/session/sqlite3session_attach.html)
71
70
  *
72
71
  * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.
73
72
  *
74
73
  * @param table The table to attach.
74
+ * @see [`sqlite3session_attach`](https://www.sqlite.org/session/sqlite3session_attach.html)
75
75
  */
76
76
  attachSync(table) {
77
77
  this.nativeSession.attachSync(this.nativeDatabase, table);
78
78
  }
79
79
  /**
80
80
  * Enable or disable the session synchronously.
81
- * @see [`sqlite3session_enable`](https://www.sqlite.org/session/sqlite3session_enable.html)
82
81
  *
83
82
  * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.
84
83
  *
85
84
  * @param enabled Whether to enable or disable the session.
85
+ * @see [`sqlite3session_enable`](https://www.sqlite.org/session/sqlite3session_enable.html)
86
86
  */
87
87
  enableSync(enabled) {
88
88
  this.nativeSession.enableSync(this.nativeDatabase, enabled);
89
89
  }
90
90
  /**
91
91
  * Close the session synchronously.
92
- * @see [`sqlite3session_delete`](https://www.sqlite.org/session/sqlite3session_delete.html)
93
92
  *
94
93
  * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.
95
94
  *
95
+ * @see [`sqlite3session_delete`](https://www.sqlite.org/session/sqlite3session_delete.html)
96
96
  */
97
97
  closeSync() {
98
98
  this.nativeSession.closeSync(this.nativeDatabase);
99
99
  }
100
100
  /**
101
101
  * Create a changeset synchronously.
102
- * @see [`sqlite3session_changeset`](https://www.sqlite.org/session/sqlite3session_changeset.html)
103
102
  *
104
103
  * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.
105
104
  *
105
+ * @see [`sqlite3session_changeset`](https://www.sqlite.org/session/sqlite3session_changeset.html)
106
106
  */
107
107
  createChangesetSync() {
108
108
  return this.nativeSession.createChangesetSync(this.nativeDatabase);
109
109
  }
110
110
  /**
111
111
  * Create an inverted changeset synchronously.
112
- * This is a shorthand for [`createChangesetSync()`](#createchangesetsync) + [`invertChangesetSync()`](#invertchangesetsync).
112
+ * This is a shorthand for [`createChangesetSync()`](#createchangesetsync) + [`invertChangesetSync()`](#invertchangesetsyncchangeset).
113
113
  *
114
114
  * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.
115
- *
116
115
  */
117
116
  createInvertedChangesetSync() {
118
117
  return this.nativeSession.createInvertedChangesetSync(this.nativeDatabase);
119
118
  }
120
119
  /**
121
120
  * Apply a changeset synchronously.
122
- * @see [`sqlite3changeset_apply`](https://www.sqlite.org/session/sqlite3changeset_apply.html)
123
121
  *
124
122
  * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.
125
123
  *
126
124
  * @param changeset The changeset to apply.
125
+ * @see [`sqlite3changeset_apply`](https://www.sqlite.org/session/sqlite3changeset_apply.html)
127
126
  */
128
127
  applyChangesetSync(changeset) {
129
128
  this.nativeSession.applyChangesetSync(this.nativeDatabase, changeset);
130
129
  }
131
130
  /**
132
131
  * Invert a changeset synchronously.
133
- * @see [`sqlite3changeset_invert`](https://www.sqlite.org/session/sqlite3changeset_invert.html)
134
132
  *
135
133
  * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.
136
134
  *
137
135
  * @param changeset The changeset to invert.
136
+ * @see [`sqlite3changeset_invert`](https://www.sqlite.org/session/sqlite3changeset_invert.html)
138
137
  */
139
138
  invertChangesetSync(changeset) {
140
139
  return this.nativeSession.invertChangesetSync(this.nativeDatabase, changeset);
@@ -1 +1 @@
1
- {"version":3,"file":"SQLiteSession.js","sourceRoot":"","sources":["../src/SQLiteSession.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,MAAM,OAAO,aAAa;IAEL;IACA;IAFnB,YACmB,cAA8B,EAC9B,aAA4B;QAD5B,mBAAc,GAAd,cAAc,CAAgB;QAC9B,kBAAa,GAAb,aAAa,CAAe;IAC5C,CAAC;IAEJ,0BAA0B;IAE1B;;;;OAIG;IACI,WAAW,CAAC,KAAoB;QACrC,OAAO,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;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MG;IACI,mBAAmB;QACxB,OAAO,IAAI,CAAC,aAAa,CAAC,mBAAmB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;OAMG;IACI,2BAA2B;QAChC,OAAO,IAAI,CAAC,aAAa,CAAC,2BAA2B,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC7E,CAAC;IAED;;;;;;;OAOG;IACI,kBAAkB,CAAC,SAAoB;QAC5C,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAC,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC;IACxE,CAAC;IAED;;;;;;;OAOG;IACI,mBAAmB,CAAC,SAAoB;QAC7C,OAAO,IAAI,CAAC,aAAa,CAAC,mBAAmB,CAAC,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC;IAChF,CAAC;CAGF","sourcesContent":["import { type NativeDatabase } from './NativeDatabase';\nimport { NativeSession, type Changeset } from './NativeSession';\n\nexport { type Changeset };\n\n/**\n * A class that represents an instance of the SQLite session extension.\n * @see [Session Extension](https://www.sqlite.org/sessionintro.html)\n */\nexport class SQLiteSession {\n constructor(\n private readonly nativeDatabase: NativeDatabase,\n private readonly nativeSession: NativeSession\n ) {}\n\n //#region Asynchronous API\n\n /**\n * Attach a table to the session asynchronously.\n * @see [`sqlite3session_attach`](https://www.sqlite.org/session/sqlite3session_attach.html)\n * @param table The table to attach. If `null`, all tables are attached.\n */\n public attachAsync(table: string | null): Promise<void> {\n return this.nativeSession.attachAsync(this.nativeDatabase, table);\n }\n\n /**\n * Enable or disable the session asynchronously.\n * @see [`sqlite3session_enable`](https://www.sqlite.org/session/sqlite3session_enable.html)\n * @param enabled Whether to enable or disable the session.\n */\n public enableAsync(enabled: boolean): Promise<void> {\n return this.nativeSession.enableAsync(this.nativeDatabase, enabled);\n }\n\n /**\n * Close the session asynchronously.\n * @see [`sqlite3session_delete`](https://www.sqlite.org/session/sqlite3session_delete.html)\n */\n public closeAsync(): Promise<void> {\n return this.nativeSession.closeAsync(this.nativeDatabase);\n }\n\n /**\n * Create a changeset asynchronously.\n * @see [`sqlite3session_changeset`](https://www.sqlite.org/session/sqlite3session_changeset.html)\n */\n public createChangesetAsync(): Promise<Changeset> {\n return this.nativeSession.createChangesetAsync(this.nativeDatabase);\n }\n\n /**\n * Create an inverted changeset asynchronously.\n * This is a shorthand for [`createChangesetAsync()`](#createchangesetasync) + [`invertChangesetAsync()`](#invertchangesetasync).\n */\n public createInvertedChangesetAsync(): Promise<Changeset> {\n return this.nativeSession.createInvertedChangesetAsync(this.nativeDatabase);\n }\n\n /**\n * Apply a changeset asynchronously.\n * @see [`sqlite3changeset_apply`](https://www.sqlite.org/session/sqlite3changeset_apply.html)\n * @param changeset The changeset to apply.\n */\n public applyChangesetAsync(changeset: Changeset): Promise<void> {\n return this.nativeSession.applyChangesetAsync(this.nativeDatabase, changeset);\n }\n\n /**\n * Invert a changeset asynchronously.\n * @see [`sqlite3changeset_invert`](https://www.sqlite.org/session/sqlite3changeset_invert.html)\n * @param changeset The changeset to invert.\n */\n public invertChangesetAsync(changeset: Changeset): Promise<Changeset> {\n return this.nativeSession.invertChangesetAsync(this.nativeDatabase, changeset);\n }\n\n //#endregion\n\n //#region Synchronous API\n\n /**\n * Attach a table to the session synchronously.\n * @see [`sqlite3session_attach`](https://www.sqlite.org/session/sqlite3session_attach.html)\n *\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n *\n * @param table The table to attach.\n */\n public attachSync(table: string | null): void {\n this.nativeSession.attachSync(this.nativeDatabase, table);\n }\n\n /**\n * Enable or disable the session synchronously.\n * @see [`sqlite3session_enable`](https://www.sqlite.org/session/sqlite3session_enable.html)\n *\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n *\n * @param enabled Whether to enable or disable the session.\n */\n public enableSync(enabled: boolean): void {\n this.nativeSession.enableSync(this.nativeDatabase, enabled);\n }\n\n /**\n * Close the session synchronously.\n * @see [`sqlite3session_delete`](https://www.sqlite.org/session/sqlite3session_delete.html)\n *\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n *\n */\n public closeSync(): void {\n this.nativeSession.closeSync(this.nativeDatabase);\n }\n\n /**\n * Create a changeset synchronously.\n * @see [`sqlite3session_changeset`](https://www.sqlite.org/session/sqlite3session_changeset.html)\n *\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n *\n */\n public createChangesetSync(): Changeset {\n return this.nativeSession.createChangesetSync(this.nativeDatabase);\n }\n\n /**\n * Create an inverted changeset synchronously.\n * This is a shorthand for [`createChangesetSync()`](#createchangesetsync) + [`invertChangesetSync()`](#invertchangesetsync).\n *\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n *\n */\n public createInvertedChangesetSync(): Changeset {\n return this.nativeSession.createInvertedChangesetSync(this.nativeDatabase);\n }\n\n /**\n * Apply a changeset synchronously.\n * @see [`sqlite3changeset_apply`](https://www.sqlite.org/session/sqlite3changeset_apply.html)\n *\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n *\n * @param changeset The changeset to apply.\n */\n public applyChangesetSync(changeset: Changeset): void {\n this.nativeSession.applyChangesetSync(this.nativeDatabase, changeset);\n }\n\n /**\n * Invert a changeset synchronously.\n * @see [`sqlite3changeset_invert`](https://www.sqlite.org/session/sqlite3changeset_invert.html)\n *\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n *\n * @param changeset The changeset to invert.\n */\n public invertChangesetSync(changeset: Changeset): Changeset {\n return this.nativeSession.invertChangesetSync(this.nativeDatabase, changeset);\n }\n\n //#endregion\n}\n"]}
1
+ {"version":3,"file":"SQLiteSession.js","sourceRoot":"","sources":["../src/SQLiteSession.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,MAAM,OAAO,aAAa;IAEL;IACA;IAFnB,YACmB,cAA8B,EAC9B,aAA4B;QAD5B,mBAAc,GAAd,cAAc,CAAgB;QAC9B,kBAAa,GAAb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CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;IAED;;;;;;OAMG;IACI,SAAS;QACd,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACpD,CAAC;IAED;;;;;;OAMG;IACI,mBAAmB;QACxB,OAAO,IAAI,CAAC,aAAa,CAAC,mBAAmB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACrE,CAAC;IAED;;;;;OAKG;IACI,2BAA2B;QAChC,OAAO,IAAI,CAAC,aAAa,CAAC,2BAA2B,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC7E,CAAC;IAED;;;;;;;OAOG;IACI,kBAAkB,CAAC,SAAoB;QAC5C,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAC,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC;IACxE,CAAC;IAED;;;;;;;OAOG;IACI,mBAAmB,CAAC,SAAoB;QAC7C,OAAO,IAAI,CAAC,aAAa,CAAC,mBAAmB,CAAC,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC;IAChF,CAAC;CAGF","sourcesContent":["import { type NativeDatabase } from './NativeDatabase';\nimport { NativeSession, type Changeset } from './NativeSession';\n\nexport { type Changeset };\n\n/**\n * A class that represents an instance of the SQLite session extension.\n * @see [Session Extension](https://www.sqlite.org/sessionintro.html)\n */\nexport class SQLiteSession {\n constructor(\n private readonly nativeDatabase: NativeDatabase,\n private readonly nativeSession: NativeSession\n ) {}\n\n //#region Asynchronous API\n\n /**\n * Attach a table to the session asynchronously.\n * @see [`sqlite3session_attach`](https://www.sqlite.org/session/sqlite3session_attach.html)\n * @param table The table to attach. If `null`, all tables are attached.\n */\n public attachAsync(table: string | null): Promise<void> {\n return this.nativeSession.attachAsync(this.nativeDatabase, table);\n }\n\n /**\n * Enable or disable the session asynchronously.\n * @see [`sqlite3session_enable`](https://www.sqlite.org/session/sqlite3session_enable.html)\n * @param enabled Whether to enable or disable the session.\n */\n public enableAsync(enabled: boolean): Promise<void> {\n return this.nativeSession.enableAsync(this.nativeDatabase, enabled);\n }\n\n /**\n * Close the session asynchronously.\n * @see [`sqlite3session_delete`](https://www.sqlite.org/session/sqlite3session_delete.html)\n */\n public closeAsync(): Promise<void> {\n return this.nativeSession.closeAsync(this.nativeDatabase);\n }\n\n /**\n * Create a changeset asynchronously.\n * @see [`sqlite3session_changeset`](https://www.sqlite.org/session/sqlite3session_changeset.html)\n */\n public createChangesetAsync(): Promise<Changeset> {\n return this.nativeSession.createChangesetAsync(this.nativeDatabase);\n }\n\n /**\n * Create an inverted changeset asynchronously.\n * This is a shorthand for [`createChangesetAsync()`](#createchangesetasync) + [`invertChangesetAsync()`](#invertchangesetasyncchangeset).\n */\n public createInvertedChangesetAsync(): Promise<Changeset> {\n return this.nativeSession.createInvertedChangesetAsync(this.nativeDatabase);\n }\n\n /**\n * Apply a changeset asynchronously.\n * @see [`sqlite3changeset_apply`](https://www.sqlite.org/session/sqlite3changeset_apply.html)\n * @param changeset The changeset to apply.\n */\n public applyChangesetAsync(changeset: Changeset): Promise<void> {\n return this.nativeSession.applyChangesetAsync(this.nativeDatabase, changeset);\n }\n\n /**\n * Invert a changeset asynchronously.\n * @see [`sqlite3changeset_invert`](https://www.sqlite.org/session/sqlite3changeset_invert.html)\n * @param changeset The changeset to invert.\n */\n public invertChangesetAsync(changeset: Changeset): Promise<Changeset> {\n return this.nativeSession.invertChangesetAsync(this.nativeDatabase, changeset);\n }\n\n //#endregion\n\n //#region Synchronous API\n\n /**\n * Attach a table to the session synchronously.\n *\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n *\n * @param table The table to attach.\n * @see [`sqlite3session_attach`](https://www.sqlite.org/session/sqlite3session_attach.html)\n */\n public attachSync(table: string | null): void {\n this.nativeSession.attachSync(this.nativeDatabase, table);\n }\n\n /**\n * Enable or disable the session synchronously.\n *\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n *\n * @param enabled Whether to enable or disable the session.\n * @see [`sqlite3session_enable`](https://www.sqlite.org/session/sqlite3session_enable.html)\n */\n public enableSync(enabled: boolean): void {\n this.nativeSession.enableSync(this.nativeDatabase, enabled);\n }\n\n /**\n * Close the session synchronously.\n *\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n *\n * @see [`sqlite3session_delete`](https://www.sqlite.org/session/sqlite3session_delete.html)\n */\n public closeSync(): void {\n this.nativeSession.closeSync(this.nativeDatabase);\n }\n\n /**\n * Create a changeset synchronously.\n *\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n *\n * @see [`sqlite3session_changeset`](https://www.sqlite.org/session/sqlite3session_changeset.html)\n */\n public createChangesetSync(): Changeset {\n return this.nativeSession.createChangesetSync(this.nativeDatabase);\n }\n\n /**\n * Create an inverted changeset synchronously.\n * This is a shorthand for [`createChangesetSync()`](#createchangesetsync) + [`invertChangesetSync()`](#invertchangesetsyncchangeset).\n *\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n */\n public createInvertedChangesetSync(): Changeset {\n return this.nativeSession.createInvertedChangesetSync(this.nativeDatabase);\n }\n\n /**\n * Apply a changeset synchronously.\n *\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n *\n * @param changeset The changeset to apply.\n * @see [`sqlite3changeset_apply`](https://www.sqlite.org/session/sqlite3changeset_apply.html)\n */\n public applyChangesetSync(changeset: Changeset): void {\n this.nativeSession.applyChangesetSync(this.nativeDatabase, changeset);\n }\n\n /**\n * Invert a changeset synchronously.\n *\n * > **Note:** Running heavy tasks with this function can block the JavaScript thread and affect performance.\n *\n * @param changeset The changeset to invert.\n * @see [`sqlite3changeset_invert`](https://www.sqlite.org/session/sqlite3changeset_invert.html)\n */\n public invertChangesetSync(changeset: Changeset): Changeset {\n return this.nativeSession.invertChangesetSync(this.nativeDatabase, changeset);\n }\n\n //#endregion\n}\n"]}
@@ -35,7 +35,9 @@ export declare class SQLiteStatement {
35
35
  * Finalize the prepared statement. This will call the [`sqlite3_finalize()`](https://www.sqlite.org/c3ref/finalize.html) C function under the hood.
36
36
  *
37
37
  * Attempting to access a finalized statement will result in an error.
38
- * > **Note:** While expo-sqlite will automatically finalize any orphaned prepared statements upon closing the database, it is considered best practice to manually finalize prepared statements as soon as they are no longer needed. This helps to prevent resource leaks. You can use the `try...finally` statement to ensure that prepared statements are finalized even if an error occurs.
38
+ * > **Note:** While `expo-sqlite` will automatically finalize any orphaned prepared statements upon closing the database, it is considered best practice
39
+ * > to manually finalize prepared statements as soon as they are no longer needed. This helps to prevent resource leaks.
40
+ * > You can use the `try...finally` statement to ensure that prepared statements are finalized even if an error occurs.
39
41
  */
40
42
  finalizeAsync(): Promise<void>;
41
43
  /**
@@ -65,7 +67,10 @@ export declare class SQLiteStatement {
65
67
  * Finalize the prepared statement. This will call the [`sqlite3_finalize()`](https://www.sqlite.org/c3ref/finalize.html) C function under the hood.
66
68
  *
67
69
  * Attempting to access a finalized statement will result in an error.
68
- * > **Note:** While expo-sqlite will automatically finalize any orphaned prepared statements upon closing the database, it is considered best practice to manually finalize prepared statements as soon as they are no longer needed. This helps to prevent resource leaks. You can use the `try...finally` statement to ensure that prepared statements are finalized even if an error occurs.
70
+ *
71
+ * > **Note:** While `expo-sqlite` will automatically finalize any orphaned prepared statements upon closing the database, it is considered best practice
72
+ * > to manually finalize prepared statements as soon as they are no longer needed. This helps to prevent resource leaks.
73
+ * > You can use the `try...finally` statement to ensure that prepared statements are finalized even if an error occurs.
69
74
  */
70
75
  finalizeSync(): void;
71
76
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SQLiteStatement.d.ts","sourceRoot":"","sources":["../src/SQLiteStatement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,wBAAwB,EAIxB,KAAK,eAAe,EACrB,MAAM,mBAAmB,CAAC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AAC,OAAO,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,YAAY,IAAI,CAAC,GAAG,IAAI,CAAC;IAEzB;;OAEG;IACH,UAAU,IAAI,CAAC,EAAE,CAAC;IAElB;;OAEG;IACH,SAAS,IAAI,IAAI,CAAC;CACnB"}
@@ -35,7 +35,9 @@ export class SQLiteStatement {
35
35
  * Finalize the prepared statement. This will call the [`sqlite3_finalize()`](https://www.sqlite.org/c3ref/finalize.html) C function under the hood.
36
36
  *
37
37
  * Attempting to access a finalized statement will result in an error.
38
- * > **Note:** While expo-sqlite will automatically finalize any orphaned prepared statements upon closing the database, it is considered best practice to manually finalize prepared statements as soon as they are no longer needed. This helps to prevent resource leaks. You can use the `try...finally` statement to ensure that prepared statements are finalized even if an error occurs.
38
+ * > **Note:** While `expo-sqlite` will automatically finalize any orphaned prepared statements upon closing the database, it is considered best practice
39
+ * > to manually finalize prepared statements as soon as they are no longer needed. This helps to prevent resource leaks.
40
+ * > You can use the `try...finally` statement to ensure that prepared statements are finalized even if an error occurs.
39
41
  */
40
42
  async finalizeAsync() {
41
43
  await this.nativeStatement.finalizeAsync(this.nativeDatabase);
@@ -66,7 +68,10 @@ export class SQLiteStatement {
66
68
  * Finalize the prepared statement. This will call the [`sqlite3_finalize()`](https://www.sqlite.org/c3ref/finalize.html) C function under the hood.
67
69
  *
68
70
  * Attempting to access a finalized statement will result in an error.
69
- * > **Note:** While expo-sqlite will automatically finalize any orphaned prepared statements upon closing the database, it is considered best practice to manually finalize prepared statements as soon as they are no longer needed. This helps to prevent resource leaks. You can use the `try...finally` statement to ensure that prepared statements are finalized even if an error occurs.
71
+ *
72
+ * > **Note:** While `expo-sqlite` will automatically finalize any orphaned prepared statements upon closing the database, it is considered best practice
73
+ * > to manually finalize prepared statements as soon as they are no longer needed. This helps to prevent resource leaks.
74
+ * > You can use the `try...finally` statement to ensure that prepared statements are finalized even if an error occurs.
70
75
  */
71
76
  finalizeSync() {
72
77
  this.nativeStatement.finalizeSync(this.nativeDatabase);