diff --git a/maubot/config.py b/maubot/config.py index c817ccc..2ee635e 100644 --- a/maubot/config.py +++ b/maubot/config.py @@ -33,6 +33,7 @@ class Config(BaseFileConfig): base = helper.base copy = helper.copy copy("database") + copy("database_opts") if isinstance(self["crypto_database"], dict): if self["crypto_database.type"] == "postgres": base["crypto_database"] = self["crypto_database.postgres_uri"] diff --git a/maubot/example-config.yaml b/maubot/example-config.yaml index 0f82e12..a1d6ce2 100644 --- a/maubot/example-config.yaml +++ b/maubot/example-config.yaml @@ -8,6 +8,14 @@ database: sqlite:///maubot.db # Separate database URL for the crypto database. "default" means use the same database as above. crypto_database: default +# Additional arguments for asyncpg.create_pool() or sqlite3.connect() +# https://magicstack.github.io/asyncpg/current/api/index.html#asyncpg.pool.create_pool +# https://docs.python.org/3/library/sqlite3.html#sqlite3.connect +# For sqlite, min_size is used as the connection thread pool size and max_size is ignored. +database_opts: + min_size: 1 + max_size: 10 + plugin_directories: # The directory where uploaded new plugins should be stored. upload: ./plugins