A lightweight ORM for Expo SQLite (expo-sqlite) that provides a model-based approach to database operations in React Native apps. Version 1.0.16 supports CRUD, filtering, pagination, search, and nested relations via TypeScript generics. It is designed specifically for Expo managed workflows and relies on expo-sqlite as a peer dependency. Key differentiators include a simple class-based schema definition, a fluent query API (filter, update, delete, paginate), and automatic table creation/initialization. The library is actively maintained with a focus on Expo SDK compatibility.
npm install an-expo-sqlite-ormNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Defines a Task model using SQLiteModel, initializes the database, and performs a create operation.
Always append .run() to any query chain, and then handle the Promise.
Only call resetDatabase() intentionally during development. In production, avoid it.
Run 'npx expo install expo-sqlite' and rebuild the project.
Ensure the schema interface matches the getSchema() return type exactly.
Add useInSearch: true to the field definition in getSchema().
Use .catch() on every .run() promise to handle errors, and ensure initDatabase() resolves before running queries.
Avoid calling initDatabase() more than once. Use a flag or state to track initialization.
Ensure the model is included in the array passed to initDatabase().