mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 10:46:06 -04:00
Add support for postgres instead of mysql. Change sql accourdingly. blob + varbinary -> bytea. No support for UNSIGNED or CREATE INDEX IF NOT EXISTS.
This commit is contained in:
parent
3c741682e5
commit
58d8339966
21 changed files with 153 additions and 140 deletions
|
@ -153,7 +153,7 @@ class EventFederationStore(SQLBaseStore):
|
|||
results = self._get_prev_events_and_state(
|
||||
txn,
|
||||
event_id,
|
||||
is_state=1,
|
||||
is_state=True,
|
||||
)
|
||||
|
||||
return [(e_id, h, ) for e_id, h, _ in results]
|
||||
|
@ -164,7 +164,7 @@ class EventFederationStore(SQLBaseStore):
|
|||
}
|
||||
|
||||
if is_state is not None:
|
||||
keyvalues["is_state"] = is_state
|
||||
keyvalues["is_state"] = bool(is_state)
|
||||
|
||||
res = self._simple_select_list_txn(
|
||||
txn,
|
||||
|
@ -259,7 +259,7 @@ class EventFederationStore(SQLBaseStore):
|
|||
"event_id": event_id,
|
||||
"prev_event_id": e_id,
|
||||
"room_id": room_id,
|
||||
"is_state": 0,
|
||||
"is_state": False,
|
||||
},
|
||||
)
|
||||
|
||||
|
@ -397,7 +397,7 @@ class EventFederationStore(SQLBaseStore):
|
|||
|
||||
query = (
|
||||
"SELECT prev_event_id FROM event_edges "
|
||||
"WHERE room_id = ? AND event_id = ? AND is_state = 0 "
|
||||
"WHERE room_id = ? AND event_id = ? AND is_state = ? "
|
||||
"LIMIT ?"
|
||||
)
|
||||
|
||||
|
@ -406,7 +406,7 @@ class EventFederationStore(SQLBaseStore):
|
|||
for event_id in front:
|
||||
txn.execute(
|
||||
query,
|
||||
(room_id, event_id, limit - len(event_results))
|
||||
(room_id, event_id, False, limit - len(event_results))
|
||||
)
|
||||
|
||||
for e_id, in txn.fetchall():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue