PIbd-42_SSPR/db/postgres_db_connection.py
AnnZhimol 49e327005e Update Database:
+ch_experiment_data in click_house
+experiment_data and experiment_parameters in postgresql
+experiment_data has foreign_key from experiment_parameters
+new connections
+realize routes for ch_experiment_data
+new alg csv_to_db
+new methods in repos
+update dockerfile
+update readme "how to init db"
2024-10-25 01:02:31 +03:00

6 lines
276 B
Python

from sqlalchemy.ext.asyncio import create_async_engine, async_sessionmaker
from settings import settings
engine_postgres = create_async_engine(url=settings.db_url_asyncpg_docker, echo=True)
async_session_postgres = async_sessionmaker(engine_postgres, expire_on_commit=False)