drizzle-team / drizzle-team/drizzle-orm
[BUG]: Column class properties don't use the narrowed types from MakeColumnConfig
- 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?
0.44.0
### What version of `drizzle-kit` are you using?
0.31.1
### Other packages
_No response_
### Describe the Bug
### What is the undesired behavior?
```typescript
export const features = pgTable("features", {
id: integer().primaryKey().generatedAlwaysAsIdentity(),
login: boolean().notNull().default(false),
});
type f = typeof features;
type t = f["login"]["hasDefault"]; // boolean
```
### What is the desired result?
```typescript
type f = typeof features;
type t = f["login"]["hasDefault"]; // true
```
### Probable fix
```typescript
export abstract class Column<
T extends ColumnBaseConfig = ColumnBaseConfig,
TRuntimeConfig extends object = object,
TTypeConfig extends object = object,
> implements DriverValueMapper, SQLWrapper {
...
readonly hasDefault: T["hasDefault"];
...
}
```
https://github.com/drizzle-team/drizzle-orm/blob/fa9aa1e0d0eb1c394b012f90d26970d89d9edd19/drizzle-orm/src/column.ts#L79
Contributor guide
Assessment
This issue has not been assessed yet.