Skip to content

fix(datastore-storage-adapter): export ExpoSQLiteAdapter and update to modern expo-sqlite API#14565

Open
anivar wants to merge 1 commit intoaws-amplify:mainfrom
anivar:fix/expo-sqlite-adapter-export
Open

fix(datastore-storage-adapter): export ExpoSQLiteAdapter and update to modern expo-sqlite API#14565
anivar wants to merge 1 commit intoaws-amplify:mainfrom
anivar:fix/expo-sqlite-adapter-export

Conversation

@anivar
Copy link
Copy Markdown
Contributor

@anivar anivar commented Sep 25, 2025

Description of changes

ExpoSQLiteAdapter was implemented but never exported from the package. The implementation used deprecated WebSQL APIs (openDatabase, transaction, executeSql) removed in expo-sqlite 13.0+, causing silent fallback to AsyncStorage with ~100x performance degradation.

Changes:

  • Export ExpoSQLiteAdapter from src/index.ts
  • Rewrite ExpoSQLiteDatabase to use expo-sqlite 13.0+ async API (openDatabaseAsync, getAllAsync, runAsync, withTransactionAsync)
  • Use require() for optional expo-sqlite/expo-file-system dependencies
  • Add optional peer dependencies for expo-sqlite >=13.0.0, expo-file-system >=13.0.0, react-native-sqlite-storage >=5.0.0
  • Enable WAL journal mode for concurrent read/write performance
  • Clear error message when expo-sqlite <13.0 is detected

Issue #, if available

Fixes #14514
Fixes #14440

Description of how you validated changes

  • 18 new unit tests for ExpoSQLiteDatabase (mocked expo-sqlite)
  • All 121 existing storage adapter tests pass (5 suites)
  • ESLint and TypeScript compilation pass

Checklist

  • PR description included
  • yarn test passes
  • Unit Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 7, 2026

🦋 Changeset detected

Latest commit: 9c33c94

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@aws-amplify/datastore-storage-adapter Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@anivar anivar force-pushed the fix/expo-sqlite-adapter-export branch from 31994c1 to 44b3643 Compare March 7, 2026 13:53
…o modern expo-sqlite API

ExpoSQLiteAdapter was implemented but never exported from the package.
The implementation used deprecated WebSQL APIs (openDatabase, transaction,
executeSql) removed in expo-sqlite 13.0+, causing silent fallback to
AsyncStorage with ~100x performance degradation.

Changes:
- Export ExpoSQLiteAdapter from package index
- Rewrite ExpoSQLiteDatabase to use expo-sqlite 13.0+ async API
- Use require() for optional expo-sqlite/expo-file-system dependencies
- Add optional peer dependencies
- Enable WAL journal mode for concurrent read/write performance
- Add 18 unit tests with mocked expo-sqlite

Fixes aws-amplify#14514 aws-amplify#14440
@anivar anivar changed the title fix(datastore-storage-adapter): export ExpoSQLiteAdapter and modernize implementation fix(datastore-storage-adapter): export ExpoSQLiteAdapter and update to modern expo-sqlite API Mar 7, 2026
@anivar anivar force-pushed the fix/expo-sqlite-adapter-export branch from 44b3643 to 9c33c94 Compare March 7, 2026 14:02
@anivar
Copy link
Copy Markdown
Contributor Author

anivar commented Mar 7, 2026

This PR addresses #14514 (Expo SQLite adapter falling back to AsyncStorage) and #14440 (DataStore not using SQLite) — the adapter is now exported and updated to the modern expo-sqlite async API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expo sqlite adapter falling back to asyncstorage, but react-native-sqlite-storage does work. Amplify datastore is not using sqlite

2 participants