Sqlite syntax error when calling useMigrations in react-native expo app
Hello,
I'm currently trying to set up a React Native app and having some problems with useMigrations. The error is complaining about the syntax but it looks fine to me:
The full SQL is here:
https://github.com/plutoniumcat/kutuba-app/blob/drizzle-problem/drizzle/0000_stale_natasha_romanoff.sql
Here's the part of my code that calls useMigrations:
https://github.com/plutoniumcat/kutuba-app/blob/drizzle-problem/src/database/DatabaseInitialization.ts
I've looked through the discord for similar issues, and added
breakpoints: true
to drizzle.config, but unfortunately that didn't help. (I also tried it with breakpoints: false
just to check and got the same error). Any suggestions on what to try next?2 Replies
Update: Managed to solve this. I've been moving things over from another repo and forgot to install babel-plugin-inline-import and update babel.config in the new repo.
Okay, actually it's not fixed. After I did the above steps, I got a new error "Migration error: cannot read property 'dialect' of undefined", implying that it wasn't importing the journal properly. So after some experimentation I went into migrations.js and changed the import/export to the following:
Now it seems to find the journal okay, but I'm back to the original SQL syntax error...
I still haven't resolved this. I have repeated all the steps for setting up drizzle with expo-sqlite from the documentation in case I missed anything and experimented with Typescript compiler and babel plugins. I regenerated the migrations (so the import statements are back how they originally were) and currently I have the "Migration error: cannot read property 'dialect' of undefined" error occurring.
Any luck? I'm still stuck in creating tables with the migration
What I'm doing now is executing the "migrations" (sql string) with expo sqlite methods