Regardless of all of the above, I still get that annoying constraint error. Why? If I am trying to insert a new record that does not have an id, shouldn't the record just get inserted with the auto-increment number assigning the id?
Just a guess here: I'm assuming you're using retool's database, right? I've had this happened to me whenever I did any changes to the column or to the table, and so I needed to reset the primary id's sequence,
A way of knowing if this is what causes the issue, just go to the table you're trying to add a row and try manually adding a row, it may throw an error like this:
I think this may be a syntactical error. Lodash._.omit() takes in an object and an array as arguments. Try writing your query like this _.omit(table1.selectedRow, ['id', 'delete', 'copy']).