Lostra
DTDrizzle Team
•Created by Lostra on 3/13/2024 in #help
"onConflictDoUpdate" fails with error in Array.flatMap
I am trying to run an upsert function, and update the values if it already exists. Now I might be completely in the wrong with the code.
I have made a base "repository" class that has the upsert function simplified as follows:
now I have tried the upsert in a loop for the array is the data happens to be an array, did not do anything, getting the same error.
4 replies
DTDrizzle Team
•Created by Lostra on 2/27/2024 in #help
Insert silently fails with missing table name?
Hi everyone!
I've been using Drizzle the past few days and so far it's been a breeze. However, I've ran into an issue today that I cannot seem to figure out.
I have a schema file that contains table definitions, like:
I am using RDS Data API with Drizzle. Created a repository service class for Clients and Accounts as well. I have the necessary functions such as getters, inserts, etc. For example, this is how a new client is inserted into the database:
This works perfectly, the client is inserted, all good. When I try to do the exact same thing with the "accounts" table however, the insert fails silently with 0 logs, 0 errors (callers are wrapped with try/catch), and as return value, I just get an empty object.
The "accounts" insert method:
Anyone has ever seen something like this?
2 replies