Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .clang-format-ignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
packages/react-native-nitro-sqlite/cpp/sqlite/*
packages/nitro-sqlite-core/cpp/sqlite/*
14 changes: 7 additions & 7 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,28 @@ reviews:
# release-please PRs only bump versions and changelogs.
ignore_title_keywords: ['chore: release']
path_filters:
- '!packages/react-native-nitro-sqlite/nitrogen/generated/**'
- '!packages/react-native-nitro-sqlite/cpp/sqlite/sqlite3.{c,h}'
- '!packages/react-native-nitro-sqlite-vec/cpp/sqlite-vec/**'
- '!packages/{react-native-nitro-sqlite,nitro-sqlite}/nitrogen/generated/**'
- '!packages/{react-native-nitro-sqlite,nitro-sqlite,nitro-sqlite-core}/cpp/sqlite/sqlite3.{c,h}'
- '!packages/integrations/{react-native,nitro-ui}/vec/cpp/sqlite-vec/**'
path_instructions:
- path: 'packages/react-native-nitro-sqlite/cpp/**'
- path: 'packages/{react-native-nitro-sqlite,nitro-sqlite,nitro-sqlite-core}/{cpp,platform/cpp}/**'
instructions: >
Trace ownership of connections, prepared statements, and row buffers
across queued work, errors, and close. Flag an interleaving that can
finalize a statement while it is in use or let one connection act on
another connection's transaction.
- path: 'packages/react-native-nitro-sqlite/src/**'
- path: 'packages/{react-native-nitro-sqlite,nitro-sqlite,nitro-sqlite-core}/{src,platform/src}/**'
instructions: >
Trace queue and transaction changes through both sync and async callers.
Look for same-connection deadlocks and pending statements that can run
after rollback. For a public contract change, compare the Nitro spec,
native implementation, and Node mock wherever they expose that behavior.
- path: 'packages/react-native-nitro-sqlite-drizzle/src/**'
- path: 'packages/{nitro-sqlite-drizzle-core,integrations/{react-native,nitro-ui}/drizzle}/src/**'
instructions: >
Check parameter binding and result column order against Drizzle's
expectations. For transaction or migration changes, trace the failure
path for partial writes or prematurely recorded migrations.
- path: 'packages/react-native-nitro-sqlite*/{*.podspec,android/**,ios/**,plugin/**,app.plugin.js,cpp/*Register*}'
- path: 'packages/{react-native-nitro-sqlite,nitro-sqlite,integrations/{react-native,nitro-ui}/vec}/{*.podspec,Package.swift,android/**,ios/**,plugin/**,app.plugin.js,cpp/*Register*}'
instructions: >
Follow changed SQLite build options through Gradle, CocoaPods, and Expo
prebuild where supported. Check that bundled builds use private SQLite
Expand Down
365 changes: 243 additions & 122 deletions .github/ci-paths.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ updates:
- package-ecosystem: 'gradle'
directories:
- '/packages/react-native-nitro-sqlite/android/'
- '/example/android/'
- '/examples/react-native/android/'
schedule:
interval: 'weekly'
day: 'monday'
Expand All @@ -37,7 +37,7 @@ updates:
- package-ecosystem: 'npm'
directories:
- '/packages/react-native-nitro-sqlite/'
- '/example/'
- '/examples/react-native/'
schedule:
interval: 'weekly'
day: 'monday'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-android-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,19 @@ jobs:
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Run Gradle Build for example/android/
working-directory: example/android
- name: Run Gradle Build for examples/react-native/android/
working-directory: examples/react-native/android
run: ./gradlew assembleRelease --no-daemon --build-cache

- name: Upload APK to Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload "${{ inputs.tag || github.event.release.tag_name }}" \
example/android/app/build/outputs/apk/release/app-release.apk#NitroSQLiteExample-${{ inputs.tag || github.event.release.tag_name }}.apk \
examples/react-native/android/app/build/outputs/apk/release/app-release.apk#RNNitroSQLiteExample-${{ inputs.tag || github.event.release.tag_name }}.apk \
--clobber

# Gradle cache doesn't like daemons
- name: Stop Gradle Daemon
working-directory: example/android
working-directory: examples/react-native/android
run: ./gradlew --stop
43 changes: 25 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ on:
paths: &ci_paths
- '.github/**'
- 'packages/**'
- 'example/**'
- 'shared/orm/**'
- 'examples/**'
- 'docs/**'
- 'scripts/**'
- 'config/**'
Expand Down Expand Up @@ -98,7 +99,7 @@ jobs:
name: ci-lockfiles
path: |
bun.lock
example/macos/Podfile.lock
examples/react-native/macos/Podfile.lock
retention-days: 1
- name: Require committed dependency resolutions
if: steps.select.outputs.dependencies == 'true'
Expand Down Expand Up @@ -130,27 +131,28 @@ jobs:
- name: Lint TypeScript
if: steps.select.outputs.typescript == 'true'
run: |
bun --cwd example lint
bun --cwd packages/react-native-nitro-sqlite lint
bun --cwd packages/react-native-nitro-sqlite-vec lint
bun --cwd packages/react-native-nitro-sqlite-drizzle lint
bun --cwd packages/react-native-nitro-sqlite-kysely lint
bun --cwd packages/react-native-nitro-sqlite-mikro-orm lint
bun --cwd packages/react-native-nitro-sqlite-typeorm lint
bun --cwd examples/react-native lint
bun --cwd packages/react-native-nitro-sqlite lint:check
bun --cwd packages/integrations/react-native/vec lint
bun --cwd packages/integrations/react-native/drizzle lint
bun --cwd packages/integrations/react-native/kysely lint
bun --cwd packages/integrations/react-native/mikro-orm lint
bun --cwd packages/integrations/react-native/typeorm lint
git diff --exit-code HEAD -- . ':(exclude)bun.lock'
- name: Test JavaScript wrappers and example runners
if: steps.select.outputs.typescript == 'true'
run: |
node --test scripts/materialize-sqlite-sources.test.mjs scripts/companion-materialize.test.mjs
node --test scripts/mikro-orm-metro.test.mjs
bun --cwd packages/react-native-nitro-sqlite build
bun --cwd packages/react-native-nitro-sqlite-typeorm build
bun --cwd packages/integrations/react-native/typeorm build
node --test scripts/typeorm-package.test.mjs
(cd packages/react-native-nitro-sqlite && ../../node_modules/.bin/jest --coverage --runInBand)
(cd packages/react-native-nitro-sqlite-vec && ../../node_modules/.bin/jest --coverage --runInBand)
(cd packages/react-native-nitro-sqlite-drizzle && ../../node_modules/.bin/jest --coverage --runInBand)
bun --cwd packages/react-native-nitro-sqlite-mikro-orm test
(cd example && ../node_modules/.bin/jest --config jest.mocha.config.js --runInBand --watchman=false)
node --test example/macos/scripts/test-macos.test.mjs
(cd packages/integrations/react-native/vec && ../../../../node_modules/.bin/jest --coverage --runInBand)
(cd packages/integrations/react-native/drizzle && ../../../../node_modules/.bin/jest --coverage --runInBand)
bun run test:orm
(cd examples/react-native && ../../node_modules/.bin/jest --config jest.mocha.config.js --runInBand --watchman=false)
node --test examples/react-native/macos/scripts/test-macos.test.mjs
bun --cwd packages/react-native-nitro-sqlite test:plugin
(cd packages/react-native-nitro-sqlite && bun run build)
- name: Format C++
Expand Down Expand Up @@ -184,9 +186,14 @@ jobs:
bun-version: 1.3.1
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Prepare both hosts from the clean checkout
run: |
bun run prepare
bun --cwd packages/react-native-nitro-sqlite specs
bun --cwd packages/nitro-sqlite specs
- name: Prepare pinned host Hermes
run: node scripts/setup-hermes-host.mjs "$RUNNER_TEMP/hermes-host"
- name: Run both Hermes conversion executables
- name: Run Hermes conversion executables for both hosts
run: bash scripts/test-cpp-hermes.sh

expo-plugin:
Expand Down Expand Up @@ -218,8 +225,8 @@ jobs:
if: matrix.sdk == 58
run: |
(cd packages/react-native-nitro-sqlite && bun run build)
bun --cwd example/expo typecheck
bun --cwd example/expo prebuild
bun --cwd examples/react-native/expo typecheck
bun --cwd examples/react-native/expo prebuild

android:
name: Android
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ jobs:
with:
ruby-version: 3.3.0
bundler-cache: true
working-directory: example
working-directory: examples/react-native
- name: Select Xcode
if: false
run: sudo xcode-select -s "/Applications/Xcode_26.5.app/Contents/Developer"
Expand Down Expand Up @@ -193,7 +193,7 @@ jobs:
run: node scripts/merge-release.ts

publish:
name: Publish both packages from the release tag
name: Publish React Native packages from the release tag
needs: [preflight, merge, release-please]
if: ${{ always() && needs.preflight.result == 'success' && (needs.merge.result == 'success' || needs.release-please.outputs.tag != '' || inputs.release_tag != '') }}
runs-on: ubuntu-24.04
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test-harness-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
run: bun install --frozen-lockfile

- name: Set minSdk in build.gradle
run: sed -i "s/minSdkVersion = 24/minSdkVersion = ${{ matrix.min_sdk }}/g" example/android/build.gradle
run: sed -i "s/minSdkVersion = 24/minSdkVersion = ${{ matrix.min_sdk }}/g" examples/react-native/android/build.gradle

- name: Setup JDK 17
uses: actions/setup-java@v6
Expand All @@ -62,11 +62,11 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-v2-
- name: Test Android SQLite build flags
run: example/android/gradlew --project-dir scripts/android-sqlite-flags testSqliteFlags --no-daemon
run: examples/react-native/android/gradlew --project-dir scripts/android-sqlite-flags testSqliteFlags --no-daemon

- name: Check Gradle configuration cache
if: matrix.min_sdk == '24' && (inputs.full || inputs.configuration)
working-directory: example/android
working-directory: examples/react-native/android
run: |
# React Native creates the autolinking file on the first run.
./gradlew :react-native-nitro-sqlite:help --configuration-cache --no-daemon
Expand All @@ -75,18 +75,18 @@ jobs:
grep -q 'Configuration cache entry reused' "$RUNNER_TEMP/nitro-sqlite-configuration-cache.log"

- name: Build Android app
working-directory: example/android
working-directory: examples/react-native/android
run: ./gradlew :app:assembleDebug --no-daemon --build-cache -PreactNativeArchitectures=${{ env.TARGET_ANDROID_ARCH }}

- name: Run Android integration tests
uses: callstackincubator/react-native-harness@v1.7.0
with:
app: android/app/build/outputs/apk/debug/app-debug.apk
runner: android
projectRoot: example
projectRoot: examples/react-native
packageManager: bun
cacheAvd: false
- name: Stop Gradle Daemon
if: always()
working-directory: example/android
working-directory: examples/react-native/android
run: ./gradlew --stop
16 changes: 8 additions & 8 deletions .github/workflows/test-harness-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,18 @@ jobs:
run: sudo xcode-select -s "/Applications/Xcode_${{ matrix.config.xcode }}.app/Contents/Developer"

- name: Generate Swift packages
working-directory: example
working-directory: examples/react-native
run: bun spm

- name: Build App
working-directory: example/ios
working-directory: examples/react-native/ios
run: |
set -o pipefail
xcodebuild \
CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ \
-derivedDataPath build/DerivedData -UseModernBuildSystem=YES \
-project NitroSQLiteExample.xcodeproj \
-scheme NitroSQLiteExample \
-project RNNitroSQLiteExample.xcodeproj \
-scheme RNNitroSQLiteExample \
-sdk iphonesimulator \
-configuration Debug \
-destination 'generic/platform=iOS Simulator' \
Expand Down Expand Up @@ -98,25 +98,25 @@ jobs:

# react-native-harness 1.5.0 fails on Xcode 27, where `simctl appinfo` errors for apps that are not installed.
- name: Install app on the iOS simulator
run: xcrun simctl install "$IOS_SIMULATOR_UDID" example/ios/build/DerivedData/Build/Products/Debug-iphonesimulator/NitroSQLiteExample.app
run: xcrun simctl install "$IOS_SIMULATOR_UDID" examples/react-native/ios/build/DerivedData/Build/Products/Debug-iphonesimulator/RNNitroSQLiteExample.app

- name: Run iOS integration tests
uses: callstackincubator/react-native-harness@v1.7.0
env:
HARNESS_DEBUG: "1"
RN_HARNESS_DIAGNOSTICS: "1"
with:
app: ios/build/DerivedData/Build/Products/Debug-iphonesimulator/NitroSQLiteExample.app
app: ios/build/DerivedData/Build/Products/Debug-iphonesimulator/RNNitroSQLiteExample.app
runner: ios
projectRoot: example
projectRoot: examples/react-native
packageManager: bun

- name: Upload iOS test diagnostics
if: always()
uses: actions/upload-artifact@v7
with:
name: harness-ios-diagnostics-xcode${{ matrix.config.xcode }}
path: example/.harness/diagnostics/**
path: examples/react-native/.harness/diagnostics/**
include-hidden-files: true
if-no-files-found: ignore
retention-days: 7
28 changes: 14 additions & 14 deletions .github/workflows/test-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,54 +51,54 @@ jobs:
with:
ruby-version: 3.3.0
bundler-cache: true
working-directory: example
working-directory: examples/react-native

- name: Select Xcode 26.5
run: sudo xcode-select -s "/Applications/Xcode_26.5.app/Contents/Developer"

- name: Restore Pods cache
uses: actions/cache@v6
with:
path: example/macos/Pods
key: ${{ runner.os }}-pods-macos-${{ hashFiles('example/macos/Podfile.lock', 'example/Gemfile.lock') }}
path: examples/react-native/macos/Pods
key: ${{ runner.os }}-pods-macos-${{ hashFiles('examples/react-native/macos/Podfile.lock', 'examples/react-native/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-macos-
- name: Clean generated macOS codegen
run: rm -rf example/macos/build/generated
run: rm -rf examples/react-native/macos/build/generated
- name: Install Pods
run: bun --cwd example pods:macos
run: bun --cwd examples/react-native pods:macos

- name: Attach refreshed native lockfiles
if: always() && inputs.lockfile
uses: actions/upload-artifact@v7
with:
name: native-lockfiles-macos
path: |
example/macos/Podfile.lock
example/Gemfile.lock
examples/react-native/macos/Podfile.lock
examples/react-native/Gemfile.lock
retention-days: 1
- name: Require committed native dependency resolutions
if: inputs.lockfile
run: |
ruby scripts/ci-pod-lockfiles.rb example/macos/Podfile.lock
git diff --exit-code -- example/Gemfile.lock
ruby scripts/ci-pod-lockfiles.rb examples/react-native/macos/Podfile.lock
git diff --exit-code -- examples/react-native/Gemfile.lock

- name: Build App
working-directory: example/macos
working-directory: examples/react-native/macos
run: |
set -o pipefail
xcodebuild \
-derivedDataPath build/DerivedData -UseModernBuildSystem=YES \
-workspace NitroSQLiteExample.xcworkspace \
-scheme NitroSQLiteExample-macOS \
-workspace RNNitroSQLiteExample.xcworkspace \
-scheme RNNitroSQLiteExample-macOS \
-configuration Debug \
-destination 'platform=macOS,arch=arm64' \
-showBuildTimingSummary \
ONLY_ACTIVE_ARCH=YES \
build \
CODE_SIGNING_ALLOWED=NO | xcbeautify --renderer github-actions
- name: Run macOS integration tests
working-directory: example/macos
working-directory: examples/react-native/macos
env:
MACOS_APP_PATH: build/DerivedData/Build/Products/Debug/NitroSQLiteExample.app
MACOS_APP_PATH: build/DerivedData/Build/Products/Debug/RNNitroSQLiteExample.app
run: bun run test
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ local.properties
*.iml
*.hprof
.cxx/
example/.cxx/
examples/react-native/.cxx/
*.keystore
!debug.keystore
.kotlin/
Expand All @@ -51,7 +51,7 @@ vendor/
# Cocoapods
#
**/Pods
example/vendor/bundle
examples/react-native/vendor/bundle

# Temporary files created by Metro to check the health of the file watcher
63 .metro-health-check*
Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*.markdown

packages/react-native-nitro-sqlite/lib
packages/react-native-nitro-sqlite-drizzle/src/__tests__/fixtures/drizzle
packages/integrations/react-native/drizzle/src/__tests__/fixtures/drizzle

.well-known
android
Expand Down
Loading
Loading