$with using sql operator doesn't return type?
Whenever I make a call to this table using db.with(companiesWithPrimaryAddress)
the type of primaryAddress is returned as 'never'? Anyone know why?
4 Replies
What's your dialect?
I see a test in pg that seems to be working properly https://github.com/drizzle-team/drizzle-orm/blob/0a4e3b265ce121675e7baa14f3a39669ea387e6d/integration-tests/tests/pg.test.ts#L2027
GitHub
drizzle-orm/integration-tests/tests/pg.test.ts at 0a4e3b265ce121675...
Headless TypeScript ORM with a head. Runs on Node, Bun and Deno. Lives on the Edge and yes, it's a JavaScript ORM too 😅 - drizzle-team/drizzle-orm
I see the same test in sql and mysql
I figured it out, I was missing the .as('primary_address') after the sql`` operator use
Thank you!