Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit ca10431

Browse files
author
David Robertson
committed
Adjust upsert-related comments
1 parent 1279801 commit ca10431

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

synapse/storage/database.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,15 +1195,16 @@ def simple_upsert_txn(
11951195
) -> bool:
11961196
"""
11971197
Pick the UPSERT method which works best on the platform. Either the
1198-
native one (Pg9.5+, recent SQLites), or fall back to an emulated method.
1198+
native one (Pg9.5+, SQLite >= 3.24), or fall back to an emulated method.
11991199
12001200
Args:
12011201
txn: The transaction to use.
12021202
table: The table to upsert into
12031203
keyvalues: The unique key tables and their new values
12041204
values: The nonunique columns and their new values
12051205
insertion_values: additional key/values to use only when inserting
1206-
lock: True to lock the table when doing the upsert.
1206+
lock: True to lock the table when doing the upsert. Unused when performing
1207+
a native upsert.
12071208
Returns:
12081209
Returns True if a row was inserted or updated (i.e. if `values` is
12091210
not empty then this always returns True)
@@ -1361,8 +1362,8 @@ async def simple_upsert_many(
13611362
value_names: The value column names
13621363
value_values: A list of each row's value column values.
13631364
Ignored if value_names is empty.
1364-
lock: True to lock the table when doing the upsert. Unused if the database engine
1365-
supports native upserts.
1365+
lock: True to lock the table when doing the upsert. Unused when performing
1366+
a native upsert.
13661367
"""
13671368

13681369
# We can autocommit if it safe to upsert
@@ -1400,8 +1401,8 @@ def simple_upsert_many_txn(
14001401
value_names: The value column names
14011402
value_values: A list of each row's value column values.
14021403
Ignored if value_names is empty.
1403-
lock: True to lock the table when doing the upsert. Unused if the database engine
1404-
supports native upserts.
1404+
lock: True to lock the table when doing the upsert. Unused when performing
1405+
a native upsert.
14051406
"""
14061407
if table not in self._unsafe_to_upsert_tables:
14071408
return self.simple_upsert_many_txn_native_upsert(

0 commit comments

Comments
 (0)