Skip to content

Commit fbbe039

Browse files
committed
Use path as-is for SQLite database
Also add bridge config migration to remove extra slashes
1 parent 0da6f45 commit fbbe039

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

mautrix/bridge/config.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,12 @@ def do_update(self, helper: ConfigUpdateHelper) -> None:
115115
copy("appservice.tls_cert")
116116
copy("appservice.tls_key")
117117

118-
copy("appservice.database")
118+
if "appservice.database" in self and self["appservice.database"].startswith("sqlite:///"):
119+
helper.base["appservice.database"] = self["appservice.database"].replace(
120+
"sqlite:///", "sqlite:"
121+
)
122+
else:
123+
copy("appservice.database")
119124
copy("appservice.database_opts")
120125

121126
copy("appservice.id")

mautrix/util/async_db/aiosqlite.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,6 @@ def __init__(
106106
)
107107
self._parent = None
108108
self._path = url.path
109-
if self._path.startswith("/"):
110-
self._path = self._path[1:]
111109
self._pool = asyncio.Queue(self._db_args.pop("min_size", 1))
112110
self._db_args.pop("max_size", None)
113111
self._stopped = False

0 commit comments

Comments
 (0)