drizzle-orm
drizzle-orm copied to clipboard
[BUG]: Relation Query type merges when using the same "with" key
What version of drizzle-orm are you using?
0.30.10
What version of drizzle-kit are you using?
0.21.13
Describe the Bug
schema:
author: text('id') // a reference to the author id
relation:
author: one(author, {... // notice the same key as the schema "author"
query:
with: {
author: true // The "author" should be the data from the author table, and not the "id" reference
}
This results is type: author: (string & {what ever type the relation query is})
Expected behavior
When using with: sameKeyAsSchema, the types shouldn't merge. It should use the types from the with relation.
Environment & setup
No response