Skip to content

Conversation

@beeman
Copy link
Contributor

@beeman beeman commented Nov 19, 2025

Description

This is an attempt to get Drizzle and Expo-SQLite working following the instructions here.

Part of #518

@cloudflare-workers-and-pages
Copy link

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

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 {
Copy link
Contributor Author

@beeman beeman Nov 19, 2025

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'
Copy link
Contributor Author

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';
Copy link
Contributor Author

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.

Comment on lines +10 to +14
.$defaultFn(() => {
const id = Math.random().toString()
console.log(` new network with id ${id}`)
return id
}),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drizzle-team/drizzle-orm#4961

We probably want to rely on something like uuid

Base automatically changed from beeman/mobile-deps to main November 19, 2025 15:56
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.

2 participants