drizzle-team / drizzle-team/drizzle-orm
[BUG]: RQB v2 nonexistent column, relation filter does not cause type error
- Dominant language
- TypeScript
- Stars
- 35.8k
- Forks
- 1.6k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 4
Description
### Report hasn't been filed before.
- [x] I have verified that the bug I'm about to report hasn't been filed before.
### What version of `drizzle-orm` are you using?
1.0.0-beta.20
### What version of `drizzle-kit` are you using?
1.0.0-beta.20
### Other packages
_No response_
### Describe the Bug
```ts
export const userTable = sqliteTable('user', {
id: text().primaryKey().$default(ulid),
contact: text().notNull(),
});
```
```ts
import { db } from '#lib/server/database.ts';
const user = await db.query.userTable.findFirst({
where: {
contact: '010',
// non-existent column or relation
contact2: '010', // No type error
},
});
```
This does result in an inaccurate runtime error. See https://github.com/drizzle-team/drizzle-orm/issues/5367
I was renaming column and relation names and forgot to update (fix) filters due to this bug.
Contributor guide
Assessment
This issue has not been assessed yet.