mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 02:24:49 -04:00
Move DB pool and helper functions into dedicated Database class
This commit is contained in:
parent
ddbbfc9512
commit
756d4942f5
62 changed files with 2377 additions and 2295 deletions
|
@ -81,7 +81,7 @@ class ClientIpStoreTestCase(unittest.HomeserverTestCase):
|
|||
self.pump(0)
|
||||
|
||||
result = self.get_success(
|
||||
self.store.simple_select_list(
|
||||
self.store.db.simple_select_list(
|
||||
table="user_ips",
|
||||
keyvalues={"user_id": user_id},
|
||||
retcols=["access_token", "ip", "user_agent", "device_id", "last_seen"],
|
||||
|
@ -112,7 +112,7 @@ class ClientIpStoreTestCase(unittest.HomeserverTestCase):
|
|||
self.pump(0)
|
||||
|
||||
result = self.get_success(
|
||||
self.store.simple_select_list(
|
||||
self.store.db.simple_select_list(
|
||||
table="user_ips",
|
||||
keyvalues={"user_id": user_id},
|
||||
retcols=["access_token", "ip", "user_agent", "device_id", "last_seen"],
|
||||
|
@ -218,7 +218,7 @@ class ClientIpStoreTestCase(unittest.HomeserverTestCase):
|
|||
|
||||
# But clear the associated entry in devices table
|
||||
self.get_success(
|
||||
self.store.simple_update(
|
||||
self.store.db.simple_update(
|
||||
table="devices",
|
||||
keyvalues={"user_id": user_id, "device_id": "device_id"},
|
||||
updatevalues={"last_seen": None, "ip": None, "user_agent": None},
|
||||
|
@ -245,7 +245,7 @@ class ClientIpStoreTestCase(unittest.HomeserverTestCase):
|
|||
|
||||
# Register the background update to run again.
|
||||
self.get_success(
|
||||
self.store.simple_insert(
|
||||
self.store.db.simple_insert(
|
||||
table="background_updates",
|
||||
values={
|
||||
"update_name": "devices_last_seen",
|
||||
|
@ -297,7 +297,7 @@ class ClientIpStoreTestCase(unittest.HomeserverTestCase):
|
|||
|
||||
# We should see that in the DB
|
||||
result = self.get_success(
|
||||
self.store.simple_select_list(
|
||||
self.store.db.simple_select_list(
|
||||
table="user_ips",
|
||||
keyvalues={"user_id": user_id},
|
||||
retcols=["access_token", "ip", "user_agent", "device_id", "last_seen"],
|
||||
|
@ -323,7 +323,7 @@ class ClientIpStoreTestCase(unittest.HomeserverTestCase):
|
|||
|
||||
# We should get no results.
|
||||
result = self.get_success(
|
||||
self.store.simple_select_list(
|
||||
self.store.db.simple_select_list(
|
||||
table="user_ips",
|
||||
keyvalues={"user_id": user_id},
|
||||
retcols=["access_token", "ip", "user_agent", "device_id", "last_seen"],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue