drizzle-team / drizzle-team/drizzle-orm
[FEATURE]: Join type in query system when foreign key is nullable
Open
improvement
rqb
- Dominant language
- TypeScript
- Stars
- 35.8k
- Forks
- 1.6k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 4
Description
### Describe what you want
Is there a way to detect if the foreign key should be nullable or not based on the query?
Current behaviour:
```
const result = await drizzleClient.query.table.findMany({
where: isNotNull(table.foreignKey),
with: {
joinTable: true,
}
});
result.joinTable // type is still nullable
```
Is there a way to declare the join type to allow for type safe joins, or detect it through isNotNull?
For example if i could join the the table with inner join and make the type required?
Contributor guide
Assessment
This issue has not been assessed yet.