From c2aa8c48bb7799ec66658cf61226f56f573d6004 Mon Sep 17 00:00:00 2001 From: Izalia Mae Date: Wed, 24 Jan 2024 19:20:27 -0500 Subject: [PATCH] ignore thread warnings in the sqlite backend for now --- relay/database/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/relay/database/__init__.py b/relay/database/__init__.py index 57f2247..ede8556 100644 --- a/relay/database/__init__.py +++ b/relay/database/__init__.py @@ -17,7 +17,12 @@ if typing.TYPE_CHECKING: def get_database(config: Config, migrate: bool = True) -> tinysql.Database: if config.db_type == "sqlite": - db = tinysql.Database.sqlite(config.sqlite_path, connection_class = Connection) + # todo: remove check_same_thread when tinysql stores connections per thread + db = tinysql.Database.sqlite( + config.sqlite_path, + connection_class = Connection, + check_same_thread = False + ) elif config.db_type == "postgres": db = tinysql.Database.postgres(