drizzle-team / drizzle-team/drizzle-orm

[BUG]: placeholder types in set to do have valid type

Open
#2,110 0 comments 2 reactions 0 assignees View on GitHub
bug qb/crud
Dominant language
TypeScript
Stars
35.8k
Forks
1.6k
Avg merge
2d 7h
Merged PRs (30d)
4

Description

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

0.30.7

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

_No response_

### Describe the Bug

sql.placeholder has to cast to any or with unknown to a specific type, because set do not allow the placeholder as value

```ts
.set({
updatedAt: sql.placeholder('updatedAt') as unknown as number
})

or

.set({
updatedAt: sql.placeholder('updatedAt')
})

```

but any is also restricted so it still a type issue

### Expected behavior

A direct assignment to the property without casting

```ts
.set({
updatedAt: sql.placeholder('updatedAt')
})
```

### Environment & setup

SQLite with Bun Adapter and Typescript

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.