cat_gateway::db::event::config

Constant UPSERT_CONFIG

Source
const UPSERT_CONFIG: &str = "-- Insert a new configuration entry into the \'config\' table\nINSERT INTO config (id1, id2, id3, value)\nVALUES ($1, $2, $3, $4) -- Values to insert for each column\n\n-- Handle conflicts when attempting to insert a row that would violate the unique constraint\nON CONFLICT (id1, id2, id3)  -- Specify the unique constraint columns that identify conflicts\n\n-- If a conflict occurs, update the existing row \'value\' column with the new value provided\nDO UPDATE SET value = excluded.value;  -- \'EXCLUDED\' refers to the values that were proposed for insertion\n";
Expand description

SQL update if exist or else insert configuration.