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

Commit ee86abb

Browse files
committed
Remove underscore from SQLBaseStore functions
1 parent c2f525a commit ee86abb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+550
-558
lines changed

scripts-dev/hash_history.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Store(object):
2727
"_store_pdu_reference_hash_txn"
2828
]
2929
_store_prev_pdu_hash_txn = SignatureStore.__dict__["_store_prev_pdu_hash_txn"]
30-
_simple_insert_txn = SQLBaseStore.__dict__["_simple_insert_txn"]
30+
simple_insert_txn = SQLBaseStore.__dict__["simple_insert_txn"]
3131

3232

3333
store = Store()

scripts/synapse_port_db

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ class Porter(object):
221221
def setup_table(self, table):
222222
if table in APPEND_ONLY_TABLES:
223223
# It's safe to just carry on inserting.
224-
row = yield self.postgres_store._simple_select_one(
224+
row = yield self.postgres_store.simple_select_one(
225225
table="port_from_sqlite3",
226226
keyvalues={"table_name": table},
227227
retcols=("forward_rowid", "backward_rowid"),
@@ -236,7 +236,7 @@ class Porter(object):
236236
)
237237
backward_chunk = 0
238238
else:
239-
yield self.postgres_store._simple_insert(
239+
yield self.postgres_store.simple_insert(
240240
table="port_from_sqlite3",
241241
values={
242242
"table_name": table,
@@ -266,7 +266,7 @@ class Porter(object):
266266

267267
yield self.postgres_store.execute(delete_all)
268268

269-
yield self.postgres_store._simple_insert(
269+
yield self.postgres_store.simple_insert(
270270
table="port_from_sqlite3",
271271
values={"table_name": table, "forward_rowid": 1, "backward_rowid": 0},
272272
)
@@ -320,7 +320,7 @@ class Porter(object):
320320
if table == "user_directory_stream_pos":
321321
# We need to make sure there is a single row, `(X, null), as that is
322322
# what synapse expects to be there.
323-
yield self.postgres_store._simple_insert(
323+
yield self.postgres_store.simple_insert(
324324
table=table, values={"stream_id": None}
325325
)
326326
self.progress.update(table, table_size) # Mark table as done
@@ -375,7 +375,7 @@ class Porter(object):
375375
def insert(txn):
376376
self.postgres_store.insert_many_txn(txn, table, headers[1:], rows)
377377

378-
self.postgres_store._simple_update_one_txn(
378+
self.postgres_store.simple_update_one_txn(
379379
txn,
380380
table="port_from_sqlite3",
381381
keyvalues={"table_name": table},
@@ -452,7 +452,7 @@ class Porter(object):
452452
],
453453
)
454454

455-
self.postgres_store._simple_update_one_txn(
455+
self.postgres_store.simple_update_one_txn(
456456
txn,
457457
table="port_from_sqlite3",
458458
keyvalues={"table_name": "event_search"},
@@ -591,11 +591,11 @@ class Porter(object):
591591

592592
# Step 2. Get tables.
593593
self.progress.set_state("Fetching tables")
594-
sqlite_tables = yield self.sqlite_store._simple_select_onecol(
594+
sqlite_tables = yield self.sqlite_store.simple_select_onecol(
595595
table="sqlite_master", keyvalues={"type": "table"}, retcol="name"
596596
)
597597

598-
postgres_tables = yield self.postgres_store._simple_select_onecol(
598+
postgres_tables = yield self.postgres_store.simple_select_onecol(
599599
table="information_schema.tables",
600600
keyvalues={},
601601
retcol="distinct table_name",
@@ -722,7 +722,7 @@ class Porter(object):
722722
next_chunk = yield self.sqlite_store.execute(get_start_id)
723723
next_chunk = max(max_inserted_rowid + 1, next_chunk)
724724

725-
yield self.postgres_store._simple_insert(
725+
yield self.postgres_store.simple_insert(
726726
table="port_from_sqlite3",
727727
values={
728728
"table_name": "sent_transactions",

synapse/app/user_dir.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def __init__(self, db_conn, hs):
6464
super(UserDirectorySlaveStore, self).__init__(db_conn, hs)
6565

6666
events_max = self._stream_id_gen.get_current_token()
67-
curr_state_delta_prefill, min_curr_state_delta_id = self._get_cache_dict(
67+
curr_state_delta_prefill, min_curr_state_delta_id = self.get_cache_dict(
6868
db_conn,
6969
"current_state_delta_stream",
7070
entity_column="room_id",

0 commit comments

Comments
 (0)