Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Revert "Don't propgate DB config upwards"
Browse files Browse the repository at this point in the history
This reverts commit c8f1458.
  • Loading branch information
David Robertson committed May 16, 2022
1 parent 44af3e4 commit 4d8b840
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions synapse/storage/engines/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.
import abc
from enum import IntEnum
from typing import TYPE_CHECKING, Generic, Optional, TypeVar
from typing import TYPE_CHECKING, Any, Generic, Mapping, Optional, TypeVar

from synapse.storage.types import Connection, Cursor, DBAPI2Module

Expand All @@ -35,7 +35,7 @@ class IncorrectDatabaseSetup(RuntimeError):


class BaseDatabaseEngine(Generic[ConnectionType], metaclass=abc.ABCMeta):
def __init__(self, module: DBAPI2Module):
def __init__(self, module: DBAPI2Module, config: Mapping[str, Any]):
self.module = module

@property
Expand Down
2 changes: 1 addition & 1 deletion synapse/storage/engines/postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class PostgresEngine(BaseDatabaseEngine["psycopg2.connection"]):
def __init__(self, database_config: Mapping[str, Any]):
import psycopg2.extensions

super().__init__(psycopg2)
super().__init__(psycopg2, database_config)
psycopg2.extensions.register_type(psycopg2.extensions.UNICODE)

# Disables passing `bytes` to txn.execute, c.f. #6186. If you do
Expand Down
2 changes: 1 addition & 1 deletion synapse/storage/engines/sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

class Sqlite3Engine(BaseDatabaseEngine[sqlite3.Connection]):
def __init__(self, database_config: Mapping[str, Any]):
super().__init__(sqlite3)
super().__init__(sqlite3, database_config)

database = database_config.get("args", {}).get("database")
self._is_in_memory = database in (
Expand Down

0 comments on commit 4d8b840

Please sign in to comment.