-
Notifications
You must be signed in to change notification settings - Fork 37
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
[Drizzle] Issue: Type Error When Inserting #477
Comments
Hey @michael-learns, could you possibly give more context? What does your database schema look like? |
We have an example insert in this test. With a schema definition at the top of the file. |
Hi @Chriztiaan ! Sorry for my late reply. So this is how I structured my AppSchema. ![]() And this is how the spaces schema looks like ![]() Then all together it looks like this ![]() When doing my query I simply import db from powersync.ts and then injected my space schema. |
Hey @michael-learns I might need minimal repo that reproduces the problem. As a note about the |
I'll try to give you a minimal repo. I've turned off typescript for that specific file for now. Thanks for the heads up on the id column! |
After applying the changes the app works when it's offline. However when syncing to supabase it conflicts with the default ID column which is just an int compared to uuid which is a bigint. @Chriztiaan |
For tables where clients will create new rows, it's recommended to use UUIDs for the Could you possibly give more context of what backend you are using, I am assuming Postgres? If this a new project, I would recommend using a text/uuid column on your backend. If this is an established backend where using an int ID is must, please see https://docs.powersync.com/usage/sync-rules/client-id. |
I have the following code.
const space = await db.insert(spaces).values({ id: '90', name: values.spaceName })
But I'm getting this error instead:
I looked it up and it possible could be a type error.
The text was updated successfully, but these errors were encountered: