diff --git a/.github/workflows/test-harness-ios.yml b/.github/workflows/test-harness-ios.yml index e73d98b1..dcc71b0b 100644 --- a/.github/workflows/test-harness-ios.yml +++ b/.github/workflows/test-harness-ios.yml @@ -60,6 +60,25 @@ jobs: - name: Select Xcode 26.2 run: sudo xcode-select -s "/Applications/Xcode_26.2.app/Contents/Developer" + - name: Start iOS simulator + run: | + set -euo pipefail + + simulator="$(xcrun simctl list devices available --json | node -e ' + const { readFileSync } = require("node:fs") + const runtime = `com.apple.CoreSimulator.SimRuntime.iOS-${process.env.IOS_SIMULATOR_OS.replaceAll(".", "-")}` + const devices = JSON.parse(readFileSync(0, "utf8")).devices[runtime] ?? [] + const device = devices.find((candidate) => candidate.name === process.env.IOS_SIMULATOR_NAME && candidate.isAvailable) + if (!device) throw new Error(`Simulator ${process.env.IOS_SIMULATOR_NAME} on ${runtime} is unavailable`) + console.log(`${device.udid} ${device.state}`) + ')" + read -r simulator_udid simulator_state <<< "$simulator" + echo "IOS_SIMULATOR_UDID=$simulator_udid" >> "$GITHUB_ENV" + + if [[ "$simulator_state" == "Shutdown" ]]; then + xcrun simctl boot "$simulator_udid" + fi + - name: Install Pods working-directory: example run: bun pods @@ -80,8 +99,14 @@ jobs: build \ CODE_SIGNING_ALLOWED=NO + - name: Wait for iOS simulator + timeout-minutes: 10 + run: xcrun simctl bootstatus "$IOS_SIMULATOR_UDID" -b + - name: Run react-native-harness on iOS uses: callstackincubator/react-native-harness@v1.5.0 + env: + HARNESS_DEBUG: "1" with: app: ios/build/Build/Products/Debug-iphonesimulator/NitroSQLiteExample.app runner: ios diff --git a/bun.lock b/bun.lock index 2bed9aba..c3b057ea 100644 --- a/bun.lock +++ b/bun.lock @@ -72,7 +72,7 @@ }, "example": { "name": "react-native-nitro-sqlite-example", - "version": "10.0.0", + "version": "10.1.0", "dependencies": { "@craftzdog/react-native-buffer": "^6.1.2", "@react-native-clipboard/clipboard": "^1.16.3", @@ -85,8 +85,8 @@ "react": "19.2.3", "react-native": "0.87.1", "react-native-nitro-modules": "*", - "react-native-nitro-sqlite": "10.0.0", - "react-native-nitro-sqlite-vec": "10.0.0", + "react-native-nitro-sqlite": "10.1.0", + "react-native-nitro-sqlite-vec": "10.1.0", "react-native-quick-base64": "^3.0.0", "react-native-quick-crypto": "^1.1.5", "react-native-safe-area-context": "^5.10.0", @@ -161,7 +161,7 @@ }, "packages/react-native-nitro-sqlite": { "name": "react-native-nitro-sqlite", - "version": "10.0.0", + "version": "10.1.0", "dependencies": { "typeorm": "1.1.1", }, @@ -188,9 +188,9 @@ }, "packages/react-native-nitro-sqlite-vec": { "name": "react-native-nitro-sqlite-vec", - "version": "10.0.0", + "version": "10.1.0", "devDependencies": { - "react-native-nitro-sqlite": "10.0.0", + "react-native-nitro-sqlite": "10.1.0", "typescript": "^5.8.3", }, "peerDependencies": { diff --git a/docs/releases/v10.1.0.md b/docs/releases/v10.1.0.md new file mode 100644 index 00000000..6569642b --- /dev/null +++ b/docs/releases/v10.1.0.md @@ -0,0 +1,21 @@ +NitroSQLite 10.1.0 adds opt-in SQLite SEE encryption support and a Node.js mock backed by better-sqlite3. We've improved repeated batch execution and query-result conversion, upgraded bundled SQLite to 3.53.4, and enabled RTree indexes by default. This release includes the connection ownership fix shipped in 10.0.1, along with the newer changes on main. + +## Encryption and Node.js testing + +You can now pass an encryption key when opening a database built with the licensed SQLite Encryption Extension. SEE source is not bundled with NitroSQLite; enabling it requires your licensed source and a native rebuild. See the [encryption guide](https://sqlite.margelo.com/docs/guides/encryption) for setup and key handling. [#410](https://github.com/margelo/react-native-nitro-sqlite/pull/410) + +The new `react-native-nitro-sqlite/mock` entry point runs against better-sqlite3 in Node.js. It supports independent connections, prepared statements, transactions, and batches for tests that need a real SQLite engine. Install better-sqlite3 separately when using the mock. [#395](https://github.com/margelo/react-native-nitro-sqlite/pull/395), [#420](https://github.com/margelo/react-native-nitro-sqlite/pull/420) + +## Query performance and SQLite support + +Grouped batch parameters reuse a prepared statement for repeated executions of the same SQL. Query results also avoid an extra native row copy during conversion to JavaScript. [#387](https://github.com/margelo/react-native-nitro-sqlite/pull/387), [#389](https://github.com/margelo/react-native-nitro-sqlite/pull/389) + +Bundled SQLite is now 3.53.4, and its symbols are isolated from other SQLite engines linked into the same app. RTree is enabled by default for spatial and range indexes. See the [queries and indexes guide](https://sqlite.margelo.com/docs/concepts/queries-and-indexes). [#392](https://github.com/margelo/react-native-nitro-sqlite/pull/392), [#390](https://github.com/margelo/react-native-nitro-sqlite/pull/390), [#425](https://github.com/margelo/react-native-nitro-sqlite/pull/425) + +## Reliability and upgrading + +Connections close with the NitroSQLite owner that opened them, so replacing a runtime can reopen the same database. We've also improved transaction cleanup and error reporting, restored `undefined` parameters as SQL NULL, preserved embedded NUL bytes in text results, and corrected column metadata types. Android temporary files now use the app cache. The changelog below links each fix. + +Update both packages to 10.1.0 if you use sqlite-vec, install Pods again on Apple platforms, and rebuild your native app. SQLite 3.53 changes floating-point-to-text conversion from 15 to 17 significant digits, so check code that depends on exact SQL text formatting. The TypeORM dependency is now 1.1.1. [#426](https://github.com/margelo/react-native-nitro-sqlite/pull/426) + +The [documentation website](https://sqlite.margelo.com/docs) now includes guides and a generated API reference. diff --git a/example/package.json b/example/package.json index 6a00d0a6..31321b64 100644 --- a/example/package.json +++ b/example/package.json @@ -1,6 +1,6 @@ { "name": "react-native-nitro-sqlite-example", - "version": "10.0.0", + "version": "10.1.0", "private": true, "nitroSQLite": { "threadSafe": true, @@ -33,8 +33,8 @@ "react": "19.2.3", "react-native": "0.87.1", "react-native-nitro-modules": "*", - "react-native-nitro-sqlite": "10.0.0", - "react-native-nitro-sqlite-vec": "10.0.0", + "react-native-nitro-sqlite": "10.1.0", + "react-native-nitro-sqlite-vec": "10.1.0", "react-native-quick-base64": "^3.0.0", "react-native-quick-crypto": "^1.1.5", "react-native-safe-area-context": "^5.10.0", diff --git a/package.json b/package.json index 4b52302b..fb85d25a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-nitro-sqlite-workspace", - "version": "10.0.0", + "version": "10.1.0", "packageManager": "bun@1.3.1", "private": "true", "workspaces": [ diff --git a/packages/react-native-nitro-sqlite-vec/package.json b/packages/react-native-nitro-sqlite-vec/package.json index 3381a9a3..182c694d 100644 --- a/packages/react-native-nitro-sqlite-vec/package.json +++ b/packages/react-native-nitro-sqlite-vec/package.json @@ -1,6 +1,6 @@ { "name": "react-native-nitro-sqlite-vec", - "version": "10.0.0", + "version": "10.1.0", "description": "Vector search (sqlite-vec) for react-native-nitro-sqlite. Native sqlite-vec is statically linked into the core's single sqlite3 — no second SQLite, no runtime extension loading.", "source": "./src/index", "react-native": "./src/index", @@ -46,7 +46,7 @@ "react-native-nitro-sqlite": ">=9.0.0" }, "devDependencies": { - "react-native-nitro-sqlite": "10.0.0", + "react-native-nitro-sqlite": "10.1.0", "typescript": "^5.8.3" }, "jest": { diff --git a/packages/react-native-nitro-sqlite/package.json b/packages/react-native-nitro-sqlite/package.json index 5c31bc50..e04cabba 100644 --- a/packages/react-native-nitro-sqlite/package.json +++ b/packages/react-native-nitro-sqlite/package.json @@ -1,6 +1,6 @@ { "name": "react-native-nitro-sqlite", - "version": "10.0.0", + "version": "10.1.0", "description": "Fast SQLite library for React Native built using Nitro Modules", "main": "./lib/module/index", "module": "./lib/module/index",