Single part at the root, COMPOSE_FILE in .env
This commit is contained in:
1 parent
321e4b6b35
commit
aac037676c
86 files changed
+68
-27
No files matched your search
+19
@@ -0,0 +1,19 @@
|
||||
{% if database == 'postgres' -%}
|
||||
async def init_db() -> None:
|
||||
from . import models # noqa: F401, PLC0415
|
||||
{%- else -%}
|
||||
from beanie import init_beanie
|
||||
from pymongo import AsyncMongoClient
|
||||
|
||||
from utils.env import env
|
||||
|
||||
client = AsyncMongoClient(env.db.connection_url)
|
||||
|
||||
|
||||
async def init_db() -> None:
|
||||
from .models import {% if dynamic_config %}DynamicConfig, {% endif %}User # noqa: PLC0415
|
||||
|
||||
{% if dynamic_config %} await init_beanie(
|
||||
database=client[env.db.db_name], document_models=[DynamicConfig, User]
|
||||
){% else %} await init_beanie(database=client[env.db.db_name], document_models=[User]){% endif %}
|
||||
{%- endif %}
|
||||
Reference in new issue
Block a user