According to the official website, Expo is an ecosystem of tools to develop, build and ship applications on React Native.
It’s powered by Hermes JavaScript runtime and Metro bundler, Drizzle Expo driver is built to natively support both.
Drizzle ORM has the best in class toolkit for Expo SQLite:
Native ORM driver for Expo SQLite ✅
Drizzle Kit support for migration generation and bundling in application ✅
Drizzle Studio dev tools plugin to browse on device database ✅
Live Queries ✅
npm
yarn
pnpm
bun
Live Queries
With useLiveQuery hook you can make any Drizzle query reactive:
Expo SQLite migrations with Drizzle Kit
You can use Drizzle Kit for SQL migration generation.
Please make sure to check how Drizzle migrations work before proceeding.
Expo / React Native requires you to have SQL migrations bundled into the app and we’ve got you covered.
Install babel plugin
It’s necessary to bundle SQL migration files as string directly to your bundle.
Update config files.
You will need to update babel.config.js, metro.config.js and drizzle.config.ts files
Make sure to have dialect: 'sqlite' and driver: 'expo' in Drizzle Kit config
Generate migrations
After creating SQL schema file and drizzle.config.ts file, you can generate migrations
Add migrations to your app
Now you need to import migrations.js file into your Expo/React Native app from ./drizzle folder.
You can run migrations on application startup using our custom useMigrations migrations hook on in useEffect hook manually as you want.