-
Notifications
You must be signed in to change notification settings - Fork 37
feat(mobile): experimental drizzle+expo+sqlite prototype #520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
samui-wallet-api | dbe726e | Commit Preview URL Branch Preview URL |
Nov 19 2025, 12:33 PM |
| import journal from './meta/_journal.json' with {type: 'json'}; | ||
| import m0000 from './0000_demonic_ultron.sql'; | ||
|
|
||
| export default { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Biome seems to struggle with parsing this format.
I think ideally, drizzle-kit should export a .ts file that we can just import.
| import { db } from '../../db/db.ts' | ||
| import migrations from '../../db/drizzle/migrations.js' | ||
| import { type Network, networksTable } from '../../db/schema.ts' | ||
| import { useMigrations } from './use-migrations.ts' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are supposed to be importing this from import { useMigrations } from 'drizzle-orm/expo-sqlite/migrator'.
owever, doing so leads to the following error:
ERROR Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.
This is probably due to having multiple React versions in our monorepo, and Expo wants us to use 19.1.0 (related to #519)
| // This file is required for Expo/React Native SQLite migrations - https://orm.drizzle.team/quick-sqlite/expo | ||
|
|
||
| import journal from './meta/_journal.json' with {type: 'json'}; | ||
| import m0000 from './0000_demonic_ultron.sql'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we'll need to exclude this file from cspell, otherwise we'll be adding new words with every migration.
| .$defaultFn(() => { | ||
| const id = Math.random().toString() | ||
| console.log(` new network with id ${id}`) | ||
| return id | ||
| }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably want to rely on something like uuid
Description
This is an attempt to get Drizzle and Expo-SQLite working following the instructions here.
Part of #518