@sqliteai/sqlite-sync-expo
v0.8.59
Published
SQLite Sync extension for Expo - Sync on-device databases with SQLite Cloud
Readme
@sqliteai/sqlite-sync-expo
SQLite Sync extension for Expo apps.
Version: 0.8.59
This package provides pre-built SQLite Sync binaries for iOS and Android, along with an Expo config plugin that automatically configures your native projects.
Installation
npm install @sqliteai/sqlite-sync-expo @op-engineering/op-sqlite
# or
yarn add @sqliteai/sqlite-sync-expo @op-engineering/op-sqliteSetup
1. Add Plugin to app.json
{
"expo": {
"plugins": ["@sqliteai/sqlite-sync-expo"]
}
}2. Run Prebuild
npx expo prebuild --cleanThe plugin will automatically:
- iOS: Copy
CloudSync.xcframeworkand add it to your Xcode project with embed & sign - Android: Copy
cloudsync.sofiles tojniLibsfor each architecture
3. Load Extension in Code
import { Platform } from 'react-native';
import { getDylibPath, open } from '@op-engineering/op-sqlite';
const db = open({ name: 'mydb.db' });
// Load SQLite Sync extension
if (Platform.OS === 'ios') {
// iOS requires the bundle ID and framework name
const path = getDylibPath('ai.sqlite.cloudsync', 'CloudSync');
db.loadExtension(path);
} else {
// Android just needs the library name
db.loadExtension('cloudsync');
}
// Verify it works
const result = db.executeSync('SELECT cloudsync_version() as version');
console.log('SQLite Sync Version:', result.rows[0].version);Supported Platforms
iOS
- arm64 (devices)
- arm64 + x86_64 simulator
Android
- arm64-v8a
- armeabi-v7a
- x86_64
Requirements
- Expo SDK 51+
- React Native 0.73+
- @op-engineering/op-sqlite for loading extensions
Links
License
See LICENSE.md
