drizzle-team / drizzle-team/drizzle-orm

[BUG]: Object literal may only specify known properties, Cannot set or Update columns not specified as NotNull

Open
#3,797 8 comments 6 reactions 0 assignees View on GitHub
bug priority qb/crud
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.38.2

### What version of `drizzle-kit` are you using?

0.0.00

### Other packages

_No response_

### Describe the Bug

When trying to update a record, if the entity being called has nullable parameters, they cannot be updated.

```
export const tblUser = mysqlTable('user', {
id: int().primaryKey(),
name: varchar({ length: 100 }).notNull(),
timestamp_seen: datetime(),
});
```

`await db.update(tblUser).set({ timestamp_seen: new Date() }).where(eq(tblUser.id, id));`

Object literal may only specify known properties, and timestamp_seen does not exist in type

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.