feat: Expo SDK 52+ support - migrate to new expo-sqlite API#1
feat: Expo SDK 52+ support - migrate to new expo-sqlite API#1
Conversation
- Replace expo-sqlite/legacy with expo-sqlite (new async API) - Use openDatabaseAsync, runAsync, getAllAsync, withTransactionAsync - Use deleteDatabaseAsync for database reset - Update peerDependencies to support expo-sqlite ^14.0.0 || ^15.0.0 - Bump version to 3.0.0 (breaking change) - Update mocks and tests for new API Made-with: Cursor
- Fix unsafe non-null assertion in withTransactionAsync with proper error handling - Improve type safety for executeBulkSql params (any[] -> (any[] | undefined)[]) - Add comprehensive tests for withTransactionAsync error cases - Add CHANGELOG.md documenting v3.0.0 breaking changes and migration guide Made-with: Cursor
- Add prominent notice explaining this is a fork of expo-sqlite-orm - Explain why fork was created (Expo SDK 52+ support) - Update all import examples to use @esign/expo-sqlite-orm - Update install instructions with correct package name - Add link to CHANGELOG.md for detailed migration info - Update credits section to acknowledge original author Made-with: Cursor
- Replace 'yarn' with 'npm ci' for dependency installation - Replace 'yarn test' with 'npm test' - Replace 'yarn build' with 'npm run build' - Use npm ci for faster, more reliable CI builds Made-with: Cursor
Add condition to publish-npm job to only run on push to master branch. This prevents the job from being evaluated/triggered on pull request events, ensuring publishing only happens when code is merged to master. Made-with: Cursor
This reverts commit 8c4cedd.
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review infoConfiguration used: defaults Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (12)
📝 WalkthroughWalkthroughThis PR migrates the project to the new Expo SQLite async API (SDK 51+), bumps the major version to 3.0.0, converts all database operations to async-first patterns with a new Changes
Sequence DiagramsequenceDiagram
participant Consumer
participant DatabaseLayer
participant Database
participant expo-sqlite as expo-sqlite API
Consumer->>DatabaseLayer: insert(obj) / update(obj) / query(options)
activate DatabaseLayer
DatabaseLayer->>Database: getDatabase()
activate Database
Database->>expo-sqlite: openDatabaseAsync()
expo-sqlite-->>Database: SQLiteDatabase
Database-->>DatabaseLayer: Promise<SQLiteDatabase>
deactivate Database
DatabaseLayer->>Database: withTransactionAsync(fn)
activate Database
Database->>expo-sqlite: db.withTransactionAsync(callback)
activate expo-sqlite
expo-sqlite->>Database: Execute transaction
Database->>Database: fn(db)
Database-->>expo-sqlite: Return result
expo-sqlite-->>Database: Transaction complete
deactivate expo-sqlite
Database-->>DatabaseLayer: Promise<T>
deactivate Database
DatabaseLayer->>expo-sqlite: runAsync / getAllAsync
expo-sqlite-->>DatabaseLayer: Results
deactivate DatabaseLayer
DatabaseLayer-->>Consumer: Promise<Result>
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
feat: Expo SDK 52+ support - migrate to new expo-sqlite API
Summary
Migrates the package from expo-sqlite legacy API to the new async API required for Expo SDK 52+.
Changes
expo-sqlite/legacywithexpo-sqliteopenDatabase()→openDatabaseAsync()transaction(callback)→withTransactionAsync()deleteAsync()→SQLite.deleteDatabaseAsync()runAsync()for INSERT/UPDATE/DELETE (returnslastInsertRowId)getAllAsync()for SELECT queriesexpo-sqlite ^14.0.0 || ^15.0.0expo-sqlite ^15.0.0Breaking change
This drops support for Expo SDK 50 and the legacy
expo-sqlite/legacyAPI. Projects must use Expo SDK 51+ with the new expo-sqlite API.Made with Cursor
Summary by CodeRabbit
Breaking Changes
Database.transaction()withDatabase.withTransactionAsync()@esign/expo-sqlite-orm; update installation and importsNew Features