I have to insert unique value for a row but has to put check on 3 columns collectively ((unique value(col1 && col2 && col3) == true)
I found a solution here it is
query = select exists(select 1 from titles where "col1"='${col1}' AND "col2"='${col2}' AND "col3"='${col3}');
This query would return true or false based on the entries of the table
if(query == true)
execute insert into table values ('col1','col2','col3','col4','col5');
I am inserting multiple records from a json file using promises.
Is there any way to execute this in single sequelize.query()
.