Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

When using TypeORM's upsert (also known as createQueryBuilder().insert().onConflict().execute()), if a record with the given unique constraint already exists in the database, it will update the existing record with the values provided. Otherwise, it will create a new record with the provided values. In other words, upsert will attempt to insert a new record, but if a record with the same unique key already exists, it will instead update the existing record with the new values.