Revize b49b6e3d
Přidáno uživatelem Matěj Zeman před asi 3 roky(ů)
server/sql_app/database.py | ||
---|---|---|
3 | 3 |
from sqlalchemy.orm import sessionmaker |
4 | 4 |
|
5 | 5 |
SQLALCHEMY_DATABASE_URL = "sqlite:///./sql_app.db" |
6 |
|
|
7 | 6 |
engine = create_engine( |
8 | 7 |
SQLALCHEMY_DATABASE_URL, connect_args={"check_same_thread": False} |
9 | 8 |
) |
9 |
#SQLALCHEMY_DATABASE_URL = "postgresql://postgres:postgres@localhost:5432/usb_api_db" |
|
10 |
''' |
|
11 |
engine = create_engine( |
|
12 |
SQLALCHEMY_DATABASE_URL |
|
13 |
) |
|
14 |
''' |
|
10 | 15 |
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine) |
11 | 16 |
|
12 | 17 |
Base = declarative_base() |
Také k dispozici: Unified diff
re #9426 Added option for communication with PostgreSQL database.