mirror of
https://github.com/zylon-ai/private-gpt.git
synced 2025-12-22 20:12:55 +01:00
11 lines
523 B
Python
11 lines
523 B
Python
from private_gpt.users.core.db_config import SQLALCHEMY_DATABASE_URI
|
|
from sqlalchemy import create_engine
|
|
from sqlalchemy.orm import sessionmaker
|
|
import logging
|
|
|
|
logging.basicConfig()
|
|
logging.getLogger("sqlalchemy.engine").setLevel(logging.INFO)
|
|
logging.getLogger("sqlalchemy.pool").setLevel(logging.DEBUG)
|
|
engine = create_engine(SQLALCHEMY_DATABASE_URI, echo=True,
|
|
future=True, pool_pre_ping=True, logging_name="myengine")
|
|
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
|