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

Commit

Permalink
Remove underscore from SQLBaseStore functions
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston committed Dec 4, 2019
1 parent c2f525a commit ee86abb
Show file tree
Hide file tree
Showing 56 changed files with 550 additions and 558 deletions.
2 changes: 1 addition & 1 deletion scripts-dev/hash_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Store(object):
"_store_pdu_reference_hash_txn"
]
_store_prev_pdu_hash_txn = SignatureStore.__dict__["_store_prev_pdu_hash_txn"]
_simple_insert_txn = SQLBaseStore.__dict__["_simple_insert_txn"]
simple_insert_txn = SQLBaseStore.__dict__["simple_insert_txn"]


store = Store()
Expand Down
18 changes: 9 additions & 9 deletions scripts/synapse_port_db
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ class Porter(object):
def setup_table(self, table):
if table in APPEND_ONLY_TABLES:
# It's safe to just carry on inserting.
row = yield self.postgres_store._simple_select_one(
row = yield self.postgres_store.simple_select_one(
table="port_from_sqlite3",
keyvalues={"table_name": table},
retcols=("forward_rowid", "backward_rowid"),
Expand All @@ -236,7 +236,7 @@ class Porter(object):
)
backward_chunk = 0
else:
yield self.postgres_store._simple_insert(
yield self.postgres_store.simple_insert(
table="port_from_sqlite3",
values={
"table_name": table,
Expand Down Expand Up @@ -266,7 +266,7 @@ class Porter(object):

yield self.postgres_store.execute(delete_all)

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

self.postgres_store._simple_update_one_txn(
self.postgres_store.simple_update_one_txn(
txn,
table="port_from_sqlite3",
keyvalues={"table_name": table},
Expand Down Expand Up @@ -452,7 +452,7 @@ class Porter(object):
],
)

self.postgres_store._simple_update_one_txn(
self.postgres_store.simple_update_one_txn(
txn,
table="port_from_sqlite3",
keyvalues={"table_name": "event_search"},
Expand Down Expand Up @@ -591,11 +591,11 @@ class Porter(object):

# Step 2. Get tables.
self.progress.set_state("Fetching tables")
sqlite_tables = yield self.sqlite_store._simple_select_onecol(
sqlite_tables = yield self.sqlite_store.simple_select_onecol(
table="sqlite_master", keyvalues={"type": "table"}, retcol="name"
)

postgres_tables = yield self.postgres_store._simple_select_onecol(
postgres_tables = yield self.postgres_store.simple_select_onecol(
table="information_schema.tables",
keyvalues={},
retcol="distinct table_name",
Expand Down Expand Up @@ -722,7 +722,7 @@ class Porter(object):
next_chunk = yield self.sqlite_store.execute(get_start_id)
next_chunk = max(max_inserted_rowid + 1, next_chunk)

yield self.postgres_store._simple_insert(
yield self.postgres_store.simple_insert(
table="port_from_sqlite3",
values={
"table_name": "sent_transactions",
Expand Down
2 changes: 1 addition & 1 deletion synapse/app/user_dir.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def __init__(self, db_conn, hs):
super(UserDirectorySlaveStore, self).__init__(db_conn, hs)

events_max = self._stream_id_gen.get_current_token()
curr_state_delta_prefill, min_curr_state_delta_id = self._get_cache_dict(
curr_state_delta_prefill, min_curr_state_delta_id = self.get_cache_dict(
db_conn,
"current_state_delta_stream",
entity_column="room_id",
Expand Down
Loading

0 comments on commit ee86abb

Please sign in to comment.