-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Nuxt Drizzle: Named column causing Error: 'Key is undefined for item. Item was not written to cache.' #20
Comments
Hello, could you try replicating your issue using a codesandbox, for example from this one? Thanks! |
I'm trying but having no luck duplicating it, I'll keep trying to find a solution with my current project and maybe I can add a note to the documentation to mention what I missed |
Did you try putting the same drizzle schema and config? |
Here is a working example that is close to my repo: I thought it might be because I have my schema in a folder like this: But it still seems to detect all the schema: I'm so confused why it's able to detect all of the schema but not their primaryKeys: Is there a way to step through the rstore $rstore-drizzle-models.d.ts file creation? |
You can try adding a breakpoint in the Then run nuxt with |
I was able to replicate the issue when you add rstore to an existing project: From what I could find while debugging: Here it accepts the books primaryKey (created after rstore-drizzle was installed) but not habits, I think it is because the keyAsName is false in the |
I created a pull request that solves the problem locally: #21 I think it still might need some further testing to best handling identifing the primaryKeys. Thank you for you patience and I'm really excited to use rstore on my projects :) |
Okay so it looks like it's an issue with named columns |
Yeah removing the name column values e.g:
===>
Name columns is causing the issue! |
Describe the bug
Loving Rstore so far, I'm building a Job Board and I'm just running into a small issue with using the new drizzle features, I've create an Office schema:
When I do a simple query it will return the offices:
It seems to not be reading the id?
Help to send any further files that could help :)
Reproduction
I am using Nuxthub/CloudFlare D1 so it is quite difficult to create a replication
System Info
Used Package Manager
pnpm
Validations
The text was updated successfully, but these errors were encountered: