summary refs log tree commit diff
path: root/synapse/storage/database.py
diff options
context:
space:
mode:
authorJason Little <realtyem@gmail.com>2023-09-15 03:16:45 -0500
committerGitHub <noreply@github.com>2023-09-15 09:16:45 +0100
commit2a0f86f88fdb3d450212541ba7db57df6a184ae3 (patch)
tree579bfc7b1dec7c5956e016ceb9a493c9ac8805fb /synapse/storage/database.py
parentOnly use literal strings for process names (#16315) (diff)
downloadsynapse-2a0f86f88fdb3d450212541ba7db57df6a184ae3.tar.xz
Convert `_insert_graph_receipts_txn` to `simple_upsert` (#16299)
Diffstat (limited to 'synapse/storage/database.py')
-rw-r--r--synapse/storage/database.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/synapse/storage/database.py b/synapse/storage/database.py

index 6c5fcdcec3..697bc5651c 100644 --- a/synapse/storage/database.py +++ b/synapse/storage/database.py
@@ -1193,6 +1193,7 @@ class DatabasePool: keyvalues: Dict[str, Any], values: Dict[str, Any], insertion_values: Optional[Dict[str, Any]] = None, + where_clause: Optional[str] = None, desc: str = "simple_upsert", ) -> bool: """Insert a row with values + insertion_values; on conflict, update with values. @@ -1243,6 +1244,7 @@ class DatabasePool: keyvalues: The unique key columns and their new values values: The nonunique columns and their new values insertion_values: additional key/values to use only when inserting + where_clause: An index predicate to apply to the upsert. desc: description of the transaction, for logging and metrics Returns: Returns True if a row was inserted or updated (i.e. if `values` is @@ -1263,6 +1265,7 @@ class DatabasePool: keyvalues, values, insertion_values, + where_clause, db_autocommit=autocommit, ) except self.engine.module.IntegrityError as e: