expo-sqlite 58.0.10 → 58.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/android/build.gradle +6 -2
- package/android/src/main/cpp/NativeDatabaseBinding.cpp +11 -8
- package/android/src/main/cpp/NativeStatementBinding.cpp +43 -2
- package/android/src/main/cpp/NativeStatementBinding.h +3 -0
- package/android/src/main/cpp/SQLiteError.h +34 -0
- package/android/src/main/java/expo/modules/sqlite/DatabaseConnection.kt +68 -0
- package/android/src/main/java/expo/modules/sqlite/NativeDatabase.kt +135 -22
- package/android/src/main/java/expo/modules/sqlite/NativeSession.kt +126 -6
- package/android/src/main/java/expo/modules/sqlite/NativeStatement.kt +199 -14
- package/android/src/main/java/expo/modules/sqlite/NativeStatementBinding.kt +1 -0
- package/android/src/main/java/expo/modules/sqlite/SQLRecords.kt +19 -13
- package/android/src/main/java/expo/modules/sqlite/SQLiteModule.kt +176 -577
- package/android/src/main/java/expo/modules/sqlite/SQLiteOptions.kt +3 -10
- package/android/src/main/java/expo/modules/sqlite/SQLiteValues.kt +47 -0
- package/build/NativeDatabase.d.ts +2 -2
- package/build/SQLiteDatabase.js +9 -3
- package/build/SQLiteDatabase.js.map +1 -1
- package/build/WebConfiguration.d.ts +31 -0
- package/build/WebConfiguration.js +21 -0
- package/build/WebConfiguration.js.map +1 -0
- package/build/index.d.ts +1 -0
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/dev-plugin-dist/+not-found.html +2 -4
- package/dev-plugin-dist/_expo/static/js/web/{__common-9b94dd2fbdbb825a662f42cf8d2077ee.js → __common-3e95e247f8ee6d975454b07047f39148.js} +52 -48
- package/dev-plugin-dist/_expo/static/js/web/{_layout-b2894030c1dfbd95b717a85901b6c271.js → _layout-0bc906c56b363d38baf86696db19957e.js} +23 -23
- package/dev-plugin-dist/_expo/static/js/web/{entry-04fdb7d857a65c0ed638ef2d774a4b6e.js → entry-293efbd088ab66af1b3334c3eeafa61f.js} +697 -696
- package/dev-plugin-dist/_expo/static/js/web/{index-4bf2da199f699eb47a42074d5e183c07.js → index-454a4f95007576080f4f47d70441d41a.js} +1740 -1740
- package/dev-plugin-dist/_expo/static/js/web/{worker-d51aa6be89e271e571111274ab8e7f5c.js → worker-172ab4a50823f055f5bd777d90d1a36a.js} +17 -17
- package/dev-plugin-dist/_sitemap.html +2 -4
- package/dev-plugin-dist/index.html +2 -4
- package/expo-module.config.json +0 -4
- package/ios/DatabaseFileUtils.swift +101 -5
- package/ios/NativeDatabase.swift +5 -8
- package/ios/NativeStatement.swift +20 -13
- package/ios/SQLiteModule.swift +8 -2
- package/ios/SQLiteResult.swift +31 -0
- package/ios/Tests/DatabaseFileUtilsTests.swift +119 -0
- package/ios/Tests/test_ErrorReporting.swift +25 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.12/expo.modules.sqlite-58.0.12-sources.jar +0 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.12/expo.modules.sqlite-58.0.12-sources.jar.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.12/expo.modules.sqlite-58.0.12-sources.jar.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.12/expo.modules.sqlite-58.0.12-sources.jar.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.12/expo.modules.sqlite-58.0.12-sources.jar.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.12/expo.modules.sqlite-58.0.12.aar +0 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.12/expo.modules.sqlite-58.0.12.aar.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.12/expo.modules.sqlite-58.0.12.aar.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.12/expo.modules.sqlite-58.0.12.aar.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.12/expo.modules.sqlite-58.0.12.aar.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/{58.0.10/expo.modules.sqlite-58.0.10.module → 58.0.12/expo.modules.sqlite-58.0.12.module} +22 -22
- package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.12/expo.modules.sqlite-58.0.12.module.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.12/expo.modules.sqlite-58.0.12.module.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.12/expo.modules.sqlite-58.0.12.module.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.12/expo.modules.sqlite-58.0.12.module.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/{58.0.10/expo.modules.sqlite-58.0.10.pom → 58.0.12/expo.modules.sqlite-58.0.12.pom} +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.12/expo.modules.sqlite-58.0.12.pom.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.12/expo.modules.sqlite-58.0.12.pom.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.12/expo.modules.sqlite-58.0.12.pom.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.12/expo.modules.sqlite-58.0.12.pom.sha512 +1 -0
- package/package.json +4 -4
- package/src/NativeDatabase.ts +2 -2
- package/src/SQLiteDatabase.ts +11 -3
- package/src/WebConfiguration.ts +36 -0
- package/src/index.ts +1 -0
- package/web/SQLiteModule.ts +16 -0
- package/web/WorkerChannel.ts +17 -9
- package/web/wa-sqlite/sqlite-api.js +4 -1
- package/web/web.types.ts +6 -0
- package/web/worker.ts +50 -38
- package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.10/expo.modules.sqlite-58.0.10-sources.jar +0 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.10/expo.modules.sqlite-58.0.10-sources.jar.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.10/expo.modules.sqlite-58.0.10-sources.jar.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.10/expo.modules.sqlite-58.0.10-sources.jar.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.10/expo.modules.sqlite-58.0.10-sources.jar.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.10/expo.modules.sqlite-58.0.10.aar +0 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.10/expo.modules.sqlite-58.0.10.aar.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.10/expo.modules.sqlite-58.0.10.aar.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.10/expo.modules.sqlite-58.0.10.aar.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.10/expo.modules.sqlite-58.0.10.aar.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.10/expo.modules.sqlite-58.0.10.module.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.10/expo.modules.sqlite-58.0.10.module.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.10/expo.modules.sqlite-58.0.10.module.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.10/expo.modules.sqlite-58.0.10.module.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.10/expo.modules.sqlite-58.0.10.pom.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.10/expo.modules.sqlite-58.0.10.pom.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.10/expo.modules.sqlite-58.0.10.pom.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.sqlite/58.0.10/expo.modules.sqlite-58.0.10.pom.sha512 +0 -1
|
@@ -2,18 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
package expo.modules.sqlite
|
|
4
4
|
|
|
5
|
-
import expo.modules.
|
|
6
|
-
import expo.modules.kotlin.records.Record
|
|
7
|
-
import expo.modules.kotlin.types.OptimizedRecord
|
|
5
|
+
import io.github.expo.modules.v2.Record
|
|
8
6
|
|
|
9
|
-
@
|
|
7
|
+
@Record
|
|
10
8
|
internal data class OpenDatabaseOptions(
|
|
11
|
-
@Field
|
|
12
9
|
val enableChangeListener: Boolean = false,
|
|
13
|
-
|
|
14
|
-
@Field
|
|
15
10
|
val useNewConnection: Boolean = false,
|
|
16
|
-
|
|
17
|
-
@Field
|
|
18
11
|
val finalizeUnusedStatementsBeforeClosing: Boolean = true
|
|
19
|
-
)
|
|
12
|
+
)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// Copyright 2015-present 650 Industries. All rights reserved.
|
|
2
|
+
|
|
3
|
+
package expo.modules.sqlite
|
|
4
|
+
|
|
5
|
+
import kotlinx.coroutines.Dispatchers
|
|
6
|
+
import kotlinx.coroutines.withContext
|
|
7
|
+
import java.nio.ByteBuffer
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* JavaScript numbers arrive as doubles, so an integral one binds as an INTEGER instead of a REAL.
|
|
11
|
+
*/
|
|
12
|
+
internal fun normalizeBindParam(param: Any?): Any? =
|
|
13
|
+
if (param is Double && param % 1.0 == 0.0) {
|
|
14
|
+
param.toLong()
|
|
15
|
+
} else {
|
|
16
|
+
param
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The binding returns a BLOB column as a direct `ByteBuffer`. It crosses to JavaScript as a
|
|
21
|
+
* `ByteArray`, which arrives as an `ArrayBuffer`.
|
|
22
|
+
*/
|
|
23
|
+
internal fun normalizeColumnValues(values: List<Any?>): List<Any?> =
|
|
24
|
+
values.map {
|
|
25
|
+
if (it is ByteBuffer) {
|
|
26
|
+
it.toByteArray()
|
|
27
|
+
} else {
|
|
28
|
+
it
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
internal fun ByteBuffer.toByteArray(): ByteArray =
|
|
33
|
+
ByteArray(remaining()).also { duplicate().get(it) }
|
|
34
|
+
|
|
35
|
+
/** A direct copy of the bytes, for the binding calls that read memory through a `ByteBuffer`. */
|
|
36
|
+
internal fun ByteArray.toDirectBuffer(): ByteBuffer =
|
|
37
|
+
ByteBuffer.allocateDirect(size).apply {
|
|
38
|
+
put(this@toDirectBuffer)
|
|
39
|
+
flip()
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Runs [block] on the IO dispatcher. A `suspend` export starts on the JS thread, and the queries
|
|
44
|
+
* must not block it.
|
|
45
|
+
*/
|
|
46
|
+
internal suspend inline fun <T> io(crossinline block: () -> T): T =
|
|
47
|
+
withContext(Dispatchers.IO) { block() }
|
|
@@ -9,7 +9,7 @@ export declare class NativeDatabase {
|
|
|
9
9
|
isInTransactionAsync(): Promise<boolean>;
|
|
10
10
|
closeAsync(): Promise<void>;
|
|
11
11
|
execAsync(source: string): Promise<void>;
|
|
12
|
-
serializeAsync(databaseName: string): Promise<Uint8Array>;
|
|
12
|
+
serializeAsync(databaseName: string): Promise<Uint8Array | ArrayBuffer>;
|
|
13
13
|
prepareAsync(nativeStatement: NativeStatement, source: string): Promise<NativeStatement>;
|
|
14
14
|
createSessionAsync(nativeSession: NativeSession, dbName: string): Promise<NativeSession>;
|
|
15
15
|
loadExtensionAsync(libPath: string, entryPoint?: string): Promise<void>;
|
|
@@ -18,7 +18,7 @@ export declare class NativeDatabase {
|
|
|
18
18
|
closeSync(): void;
|
|
19
19
|
interruptSync(): void;
|
|
20
20
|
execSync(source: string): void;
|
|
21
|
-
serializeSync(databaseName: string): Uint8Array;
|
|
21
|
+
serializeSync(databaseName: string): Uint8Array | ArrayBuffer;
|
|
22
22
|
prepareSync(nativeStatement: NativeStatement, source: string): NativeStatement;
|
|
23
23
|
createSessionSync(nativeSession: NativeSession, dbName: string): NativeSession;
|
|
24
24
|
loadExtensionSync(libPath: string, entryPoint?: string): void;
|
package/build/SQLiteDatabase.js
CHANGED
|
@@ -41,8 +41,8 @@ import { createDatabasePath } from './pathUtils';
|
|
|
41
41
|
* [Serialize the database](https://sqlite.org/c3ref/serialize.html) as `Uint8Array`.
|
|
42
42
|
*
|
|
43
43
|
* @param databaseName The name of the current attached databases. The default value is `main` which is the default database name.
|
|
44
|
-
*/ serializeAsync(databaseName = 'main') {
|
|
45
|
-
return this.nativeDatabase.serializeAsync(databaseName);
|
|
44
|
+
*/ async serializeAsync(databaseName = 'main') {
|
|
45
|
+
return toUint8Array(await this.nativeDatabase.serializeAsync(databaseName));
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
48
|
* Create a [prepared SQLite statement](https://www.sqlite.org/c3ref/prepare.html).
|
|
@@ -220,7 +220,7 @@ import { createDatabasePath } from './pathUtils';
|
|
|
220
220
|
*
|
|
221
221
|
* @param databaseName The name of the current attached databases. The default value is `main` which is the default database name.
|
|
222
222
|
*/ serializeSync(databaseName = 'main') {
|
|
223
|
-
return this.nativeDatabase.serializeSync(databaseName);
|
|
223
|
+
return toUint8Array(this.nativeDatabase.serializeSync(databaseName));
|
|
224
224
|
}
|
|
225
225
|
/**
|
|
226
226
|
* Create a [prepared SQLite statement](https://www.sqlite.org/c3ref/prepare.html).
|
|
@@ -547,5 +547,11 @@ import { createDatabasePath } from './pathUtils';
|
|
|
547
547
|
return new Transaction(db.databasePath, options, nativeDatabase);
|
|
548
548
|
}
|
|
549
549
|
}
|
|
550
|
+
/**
|
|
551
|
+
* The native database hands serialized bytes over as a `Uint8Array` on iOS and as an `ArrayBuffer`
|
|
552
|
+
* on Android.
|
|
553
|
+
*/ function toUint8Array(data) {
|
|
554
|
+
return data instanceof Uint8Array ? data : new Uint8Array(data);
|
|
555
|
+
}
|
|
550
556
|
|
|
551
557
|
//# sourceMappingURL=SQLiteDatabase.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["SQLiteDatabase.ts"],"sourcesContent":[null],"names":["Platform","ExpoSQLite","registerDatabaseForDevToolsAsync","unregisterDatabaseForDevToolsAsync","SQLiteSession","SQLiteStatement","SQLiteTaggedQuery","createDatabasePath","SQLiteDatabase","databasePath","options","nativeDatabase","isInTransactionAsync","closeAsync","useNewConnection","execAsync","source","serializeAsync","databaseName","prepareAsync","nativeStatement","NativeStatement","createSessionAsync","dbName","nativeSession","NativeSession","loadExtensionAsync","libPath","entryPoint","withTransactionAsync","task","e","withExclusiveTransactionAsync","OS","Error","transaction","Transaction","createAsync","error","isInTransactionSync","interruptSync","closeSync","execSync","serializeSync","prepareSync","createSessionSync","loadExtensionSync","withTransactionSync","sql","strings","values","runAsync","params","statement","result","executeAsync","finalizeAsync","getFirstAsync","firstRow","getEachAsync","row","getAllAsync","allRows","runSync","executeSync","finalizeSync","getFirstSync","getEachSync","getAllSync","defaultDatabaseDirectory","bundledExtensions","openDatabaseAsync","directory","openOptions","ensureDatabasePathExistsAsync","NativeDatabase","initAsync","database","openDatabaseSync","ensureDatabasePathExistsSync","initSync","deserializeDatabaseAsync","serializedData","deserializeDatabaseSync","deleteDatabaseAsync","deleteDatabaseSync","backupDatabaseAsync","sourceDatabase","sourceDatabaseName","destDatabase","destDatabaseName","backupDatabaseSync","addDatabaseChangeListener","listener","addListener","db"],"mappings":"AACA,SAASA,QAAQ,QAAQ,eAAe;AAExC,OAAOC,gBAAgB,eAAe;AAEtC,SACEC,gCAAgC,EAChCC,kCAAkC,QAC7B,yBAAyB;AAChC,SAASC,aAAa,QAAQ,kBAAkB;AAQhD,SAASC,eAAe,QAAQ,oBAAoB;AACpD,SAASC,iBAAiB,QAAQ,sBAAsB;AACxD,SAASC,kBAAkB,QAAQ,cAAc;AAIjD;;CAEC,GACD,OAAO,MAAMC;;;;IACX,YACE,AAAgBC,YAAoB,EACpC,AAAgBC,OAA0B,EAC1C,AAAgBC,cAA8B,CAC9C;aAHgBF,eAAAA;aACAC,UAAAA;aACAC,iBAAAA;IACf;IAEH;;GAEC,GACD,AAAOC,uBAAyC;QAC9C,OAAO,IAAI,CAACD,cAAc,CAACC,oBAAoB;IACjD;IAEA;;GAEC,GACD,AAAOC,aAA4B;QACjC,IAAI,IAAI,CAACH,OAAO,CAACI,gBAAgB,KAAK,MAAM;YAC1CX,mCAAmC,IAAI;QACzC;QACA,OAAO,IAAI,CAACQ,cAAc,CAACE,UAAU;IACvC;IAEA;;;;;GAKC,GACD,AAAOE,UAAUC,MAAc,EAAiB;QAC9C,OAAO,IAAI,CAACL,cAAc,CAACI,SAAS,CAACC;IACvC;IAEA;;;;GAIC,GACD,
|
|
1
|
+
{"version":3,"sources":["SQLiteDatabase.ts"],"sourcesContent":[null],"names":["Platform","ExpoSQLite","registerDatabaseForDevToolsAsync","unregisterDatabaseForDevToolsAsync","SQLiteSession","SQLiteStatement","SQLiteTaggedQuery","createDatabasePath","SQLiteDatabase","databasePath","options","nativeDatabase","isInTransactionAsync","closeAsync","useNewConnection","execAsync","source","serializeAsync","databaseName","toUint8Array","prepareAsync","nativeStatement","NativeStatement","createSessionAsync","dbName","nativeSession","NativeSession","loadExtensionAsync","libPath","entryPoint","withTransactionAsync","task","e","withExclusiveTransactionAsync","OS","Error","transaction","Transaction","createAsync","error","isInTransactionSync","interruptSync","closeSync","execSync","serializeSync","prepareSync","createSessionSync","loadExtensionSync","withTransactionSync","sql","strings","values","runAsync","params","statement","result","executeAsync","finalizeAsync","getFirstAsync","firstRow","getEachAsync","row","getAllAsync","allRows","runSync","executeSync","finalizeSync","getFirstSync","getEachSync","getAllSync","defaultDatabaseDirectory","bundledExtensions","openDatabaseAsync","directory","openOptions","ensureDatabasePathExistsAsync","NativeDatabase","initAsync","database","openDatabaseSync","ensureDatabasePathExistsSync","initSync","deserializeDatabaseAsync","serializedData","deserializeDatabaseSync","deleteDatabaseAsync","deleteDatabaseSync","backupDatabaseAsync","sourceDatabase","sourceDatabaseName","destDatabase","destDatabaseName","backupDatabaseSync","addDatabaseChangeListener","listener","addListener","db","data","Uint8Array"],"mappings":"AACA,SAASA,QAAQ,QAAQ,eAAe;AAExC,OAAOC,gBAAgB,eAAe;AAEtC,SACEC,gCAAgC,EAChCC,kCAAkC,QAC7B,yBAAyB;AAChC,SAASC,aAAa,QAAQ,kBAAkB;AAQhD,SAASC,eAAe,QAAQ,oBAAoB;AACpD,SAASC,iBAAiB,QAAQ,sBAAsB;AACxD,SAASC,kBAAkB,QAAQ,cAAc;AAIjD;;CAEC,GACD,OAAO,MAAMC;;;;IACX,YACE,AAAgBC,YAAoB,EACpC,AAAgBC,OAA0B,EAC1C,AAAgBC,cAA8B,CAC9C;aAHgBF,eAAAA;aACAC,UAAAA;aACAC,iBAAAA;IACf;IAEH;;GAEC,GACD,AAAOC,uBAAyC;QAC9C,OAAO,IAAI,CAACD,cAAc,CAACC,oBAAoB;IACjD;IAEA;;GAEC,GACD,AAAOC,aAA4B;QACjC,IAAI,IAAI,CAACH,OAAO,CAACI,gBAAgB,KAAK,MAAM;YAC1CX,mCAAmC,IAAI;QACzC;QACA,OAAO,IAAI,CAACQ,cAAc,CAACE,UAAU;IACvC;IAEA;;;;;GAKC,GACD,AAAOE,UAAUC,MAAc,EAAiB;QAC9C,OAAO,IAAI,CAACL,cAAc,CAACI,SAAS,CAACC;IACvC;IAEA;;;;GAIC,GACD,MAAaC,eAAeC,eAAuB,MAAM,EAAuB;QAC9E,OAAOC,aAAa,MAAM,IAAI,CAACR,cAAc,CAACM,cAAc,CAACC;IAC/D;IAEA;;;;GAIC,GACD,MAAaE,aAAaJ,MAAc,EAA4B;QAClE,MAAMK,kBAAkB,IAAIpB,WAAWqB,eAAe;QACtD,MAAM,I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AiB,IAAIV,WAAW2E,cAAc,CAACoB,GAAGvF,YAAY,EAAEC;QACtE,MAAMC,eAAekE,SAAS;QAC9B,OAAO,IAAIxC,YAAY2D,GAAGvF,YAAY,EAAEC,SAASC;IACnD;AACF;AAEA;;;CAGC,GACD,SAASQ,aAAa8E,IAA8B;IAClD,OAAOA,gBAAgBC,aAAaD,OAAO,IAAIC,WAAWD;AAC5D"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for [`configureWeb()`](#sqliteconfigureweboptions).
|
|
3
|
+
* @platform web
|
|
4
|
+
*/
|
|
5
|
+
export interface SQLiteWebOptions {
|
|
6
|
+
/**
|
|
7
|
+
* The URL of a custom wa-sqlite WebAssembly build, for example one built with FTS enabled.
|
|
8
|
+
* When omitted, `expo-sqlite` uses its bundled build.
|
|
9
|
+
*
|
|
10
|
+
* The build must come from the [`expo/wa-sqlite`](https://github.com/expo/wa-sqlite) revision that matches your `expo-sqlite` version.
|
|
11
|
+
* A build from another revision may fail to load.
|
|
12
|
+
*/
|
|
13
|
+
wasmURL?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Configures how `expo-sqlite` runs on web.
|
|
17
|
+
* Each call replaces the options from the previous call.
|
|
18
|
+
* It has no effect on Android, iOS, and server rendering.
|
|
19
|
+
*
|
|
20
|
+
* Call it before opening any database.
|
|
21
|
+
* It throws if `wasmURL` changes after a database is opened, because the web worker loads SQLite only once.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* SQLite.configureWeb({ wasmURL: require('./assets/wa-sqlite-fts.wasm') });
|
|
26
|
+
* const db = await SQLite.openDatabaseAsync('app.db');
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @platform web
|
|
30
|
+
*/
|
|
31
|
+
export declare function configureWeb(options: SQLiteWebOptions): void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import ExpoSQLite from './ExpoSQLite';
|
|
2
|
+
/**
|
|
3
|
+
* Configures how `expo-sqlite` runs on web.
|
|
4
|
+
* Each call replaces the options from the previous call.
|
|
5
|
+
* It has no effect on Android, iOS, and server rendering.
|
|
6
|
+
*
|
|
7
|
+
* Call it before opening any database.
|
|
8
|
+
* It throws if `wasmURL` changes after a database is opened, because the web worker loads SQLite only once.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* SQLite.configureWeb({ wasmURL: require('./assets/wa-sqlite-fts.wasm') });
|
|
13
|
+
* const db = await SQLite.openDatabaseAsync('app.db');
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @platform web
|
|
17
|
+
*/ export function configureWeb(options) {
|
|
18
|
+
ExpoSQLite.configureWeb?.(options);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=WebConfiguration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["WebConfiguration.ts"],"sourcesContent":[null],"names":["ExpoSQLite","configureWeb","options"],"mappings":"AAAA,OAAOA,gBAAgB,eAAe;AAiBtC;;;;;;;;;;;;;;;CAeC,GACD,OAAO,SAASC,aAAaC,OAAyB;IACpDF,WAAWC,YAAY,GAAGC;AAC5B"}
|
package/build/index.d.ts
CHANGED
package/build/index.js
CHANGED
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA,cAAc,mBAAmB;AACjC,cAAc,kBAAkB;AAChC,cAAc,oBAAoB;AAClC,cAAc,sBAAsB;AACpC,cAAc,UAAU"}
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":[null],"names":["configureWeb"],"mappings":"AAAA,cAAc,mBAAmB;AACjC,cAAc,kBAAkB;AAChC,cAAc,oBAAoB;AAClC,cAAc,sBAAsB;AACpC,cAAc,UAAU;AACxB,SAASA,YAAY,QAA+B,qBAAqB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><html
|
|
1
|
+
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><link rel="preload" href="/_expo/plugins/expo-sqlite/_expo/static/css/global-b1bdf830cdbd0ec4238cc5f230f99460.css" as="style"/><link rel="preload" href="/_expo/plugins/expo-sqlite/_expo/static/js/web/__expo-metro-runtime-8c088df87a31e4e6accd81c554ec290d.js" as="script"/><link rel="preload" href="/_expo/plugins/expo-sqlite/_expo/static/js/web/_layout-0bc906c56b363d38baf86696db19957e.js" as="script"/><link rel="preload" href="/_expo/plugins/expo-sqlite/_expo/static/js/web/__common-3e95e247f8ee6d975454b07047f39148.js" as="script"/><link rel="preload" href="/_expo/plugins/expo-sqlite/_expo/static/js/web/entry-293efbd088ab66af1b3334c3eeafa61f.js" as="script"/><style id="expo-reset">#root,body,html{height:100%}body{overflow:hidden}#root{display:flex}</style><style id="react-native-stylesheet">[stylesheet-group="0"]{}
|
|
2
2
|
body{margin:0;}
|
|
3
3
|
button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}
|
|
4
4
|
html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);}
|
|
@@ -313,6 +313,4 @@ input::-webkit-search-cancel-button,input::-webkit-search-decoration,input::-web
|
|
|
313
313
|
@keyframes r-1pzkwqh{0%{transform:translateY(100%);}100%{transform:translateY(0%);}}
|
|
314
314
|
@keyframes r-imtty0{0%{opacity:0;}100%{opacity:1;}}
|
|
315
315
|
@keyframes r-q67da2{0%{transform:translateX(-100%);}100%{transform:translateX(400%);}}
|
|
316
|
-
@keyframes r-t2lo5v{0%{opacity:1;}100%{opacity:0;}}</style><script
|
|
317
|
-
<link rel="stylesheet" href="/_expo/plugins/expo-sqlite/_expo/static/css/global-b1bdf830cdbd0ec4238cc5f230f99460.css"></head><body><div id="root"><div class="css-g5y9jx r-13awgt0"></div></div><script src="/_expo/plugins/expo-sqlite/_expo/static/js/web/__expo-metro-runtime-8c088df87a31e4e6accd81c554ec290d.js" defer></script><script src="/_expo/plugins/expo-sqlite/_expo/static/js/web/_layout-b2894030c1dfbd95b717a85901b6c271.js" defer></script><script src="/_expo/plugins/expo-sqlite/_expo/static/js/web/__common-9b94dd2fbdbb825a662f42cf8d2077ee.js" defer></script><script src="/_expo/plugins/expo-sqlite/_expo/static/js/web/entry-04fdb7d857a65c0ed638ef2d774a4b6e.js" defer></script>
|
|
318
|
-
</body></html>
|
|
316
|
+
@keyframes r-t2lo5v{0%{opacity:1;}100%{opacity:0;}}</style><link rel="stylesheet" href="/_expo/plugins/expo-sqlite/_expo/static/css/global-b1bdf830cdbd0ec4238cc5f230f99460.css"/></head><body><div id="root"><!--$--><div class="css-g5y9jx r-13awgt0"></div><!--/$--></div><script defer="" src="/_expo/plugins/expo-sqlite/_expo/static/js/web/__expo-metro-runtime-8c088df87a31e4e6accd81c554ec290d.js"></script><script defer="" src="/_expo/plugins/expo-sqlite/_expo/static/js/web/_layout-0bc906c56b363d38baf86696db19957e.js"></script><script defer="" src="/_expo/plugins/expo-sqlite/_expo/static/js/web/__common-3e95e247f8ee6d975454b07047f39148.js"></script><script defer="" src="/_expo/plugins/expo-sqlite/_expo/static/js/web/entry-293efbd088ab66af1b3334c3eeafa61f.js"></script><script id="_R_">globalThis.__EXPO_ROUTER_HYDRATE__=true;</script></body></html>
|