mirror of
https://github.com/zylon-ai/private-gpt.git
synced 2025-12-22 20:12:55 +01:00
Added users model for authentication with roles and user roles
This commit is contained in:
parent
0a89d76cc5
commit
b67b66cd44
53 changed files with 1955 additions and 43 deletions
13
private_gpt/users/db/session.py
Normal file
13
private_gpt/users/db/session.py
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
from private_gpt.users.core.config import SQLALCHEMY_DATABASE_URI
|
||||
from sqlalchemy import create_engine
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
|
||||
engine = create_engine(SQLALCHEMY_DATABASE_URI, echo=True, future=True, pool_pre_ping=True)
|
||||
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
|
||||
|
||||
# test_engine = create_engine(
|
||||
# f"{settings.SQLALCHEMY_DATABASE_URI}_test", pool_pre_ping=True
|
||||
# )
|
||||
# TestingSessionLocal = sessionmaker(
|
||||
# autocommit=False, autoflush=False, bind=test_engine
|
||||
# )
|
||||
Loading…
Add table
Add a link
Reference in a new issue