Skip to content

Commit 7c60ee9

Browse files
committed
Remove SQLAlchemy state store stuff. Fixes mautrix#147
1 parent fbbe039 commit 7c60ee9

File tree

15 files changed

+4
-455
lines changed

15 files changed

+4
-455
lines changed

docs/api/mautrix.client.state_store/index.rst

-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@ Implementations
1313

1414
In-memory<memory>
1515
Async database (asyncpg/aiosqlite)<asyncpg>
16-
Legacy database (SQLAlchemy)<sqlalchemy>
1716
Flat file<file>

docs/api/mautrix.client.state_store/sqlalchemy.rst

-5
This file was deleted.
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from .file import FileASStateStore
22
from .memory import ASStateStore
33

4-
__all__ = ["FileASStateStore", "ASStateStore", "sqlalchemy", "asyncpg"]
4+
__all__ = ["FileASStateStore", "ASStateStore", "asyncpg"]

mautrix/appservice/state_store/sqlalchemy.py

-14
This file was deleted.

mautrix/bridge/crypto_state_store.py

-23
Original file line numberDiff line numberDiff line change
@@ -28,29 +28,6 @@ async def is_encrypted(self, room_id: RoomID) -> bool:
2828
return portal.encrypted if portal else False
2929

3030

31-
try:
32-
from mautrix.client.state_store.sqlalchemy import RoomState, UserProfile
33-
34-
class SQLCryptoStateStore(BaseCryptoStateStore):
35-
@staticmethod
36-
async def find_shared_rooms(user_id: UserID) -> list[RoomID]:
37-
return [profile.room_id for profile in UserProfile.find_rooms_with_user(user_id)]
38-
39-
@staticmethod
40-
async def get_encryption_info(room_id: RoomID) -> RoomEncryptionStateEventContent | None:
41-
state = RoomState.get(room_id)
42-
if not state:
43-
return None
44-
return state.encryption
45-
46-
except ImportError:
47-
if __optional_imports__:
48-
raise
49-
UserProfile = None
50-
RoomState = None
51-
SQLCryptoStateStore = None
52-
53-
5431
class PgCryptoStateStore(BaseCryptoStateStore):
5532
db: Database
5633

mautrix/bridge/e2ee.py

-7
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,6 @@
4141
from .. import bridge as br
4242
from .crypto_state_store import PgCryptoStateStore
4343

44-
try:
45-
from mautrix.client.state_store.sqlalchemy import UserProfile
46-
except ImportError:
47-
if __optional_imports__:
48-
raise
49-
UserProfile = None
50-
5144

5245
class EncryptionManager:
5346
loop: asyncio.AbstractEventLoop
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__all__ = ["asyncpg", "sqlalchemy"]
1+
__all__ = ["asyncpg"]

mautrix/bridge/state_store/sqlalchemy.py

-41
This file was deleted.

mautrix/client/state_store/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@
1010
"MemorySyncStore",
1111
"SyncStore",
1212
"asyncpg",
13-
"sqlalchemy",
1413
]

mautrix/client/state_store/sqlalchemy/__init__.py

-3
This file was deleted.

mautrix/client/state_store/sqlalchemy/mx_room_state.py

-66
This file was deleted.

mautrix/client/state_store/sqlalchemy/mx_user_profile.py

-94
This file was deleted.

0 commit comments

Comments
 (0)