The "INSERT OR UPDATE" operation, often referred to as "UPSERT," is a database operation that either inserts a new row into a table if it doesn't already exist or updates an existing row if it does. In SQLite, there isn't a single SQL statement for UPSERT like in some other database systems. But there is "INSERT OR REPLACE", which is a SQL statement used to add a new row to a table. If a row with a matching key already exists, it updates that row with the new data. This method entirely replaces the existing row with the updated information.
Source code viewer
INSERT OR REPLACE INTO TABLE_NAME (column1, column2, ...) VALUES (value1, value2, ...);Programming Language: SQL