murderous rampage
murderous rampage
DTDrizzle Team
Created by murderous rampage on 3/29/2024 in #help
Appending to array OnConflictUpdate()? (Postgres)
full question on stack overflow: https://stackoverflow.com/questions/78246191/error-appending-to-array-oonconflictupdaste-using-drizzle-orm-postgresql Am I missing something? Found nothing on it on the docs. How can I achieve this in Drizzle?
INSERT INTO users (email, ip_list, name, phone, is_admin, password)
VALUES ($1, $2, $3, $4, $5, $6)
ON CONFLICT (email) DO UPDATE
SET ip_list = array_append(users.ip_list, $7::INET[])
RETURNING id;
INSERT INTO users (email, ip_list, name, phone, is_admin, password)
VALUES ($1, $2, $3, $4, $5, $6)
ON CONFLICT (email) DO UPDATE
SET ip_list = array_append(users.ip_list, $7::INET[])
RETURNING id;
1 replies