drizzle-team / drizzle-team/drizzle-orm

[FEATURE]: Allow sql magic in target in onConfilict

Open
#2,646 3 comments 6 reactions 0 assignees View on GitHub
db/postgres db/sqlite enhancement improvement priority qb/crud
Dominant language
TypeScript
Stars
35.8k
Forks
1.6k
Avg merge
2d 7h
Merged PRs (30d)
4

Description

### Describe what you want

I'm trying to do something like this:

```
const [createdUser] = await tx
.insert(users)
.values({
name: user.name,
email: user.email,
image: user.picture,
})
.onConflictDoNothing({
target: sql`lower(${users.email})`
})
```

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.