1 |
aba60b70
|
Matej Zeman
|
from sqlalchemy import create_engine
|
2 |
|
|
from sqlalchemy.ext.declarative import declarative_base
|
3 |
|
|
from sqlalchemy.orm import sessionmaker
|
4 |
ef87a1d2
|
Matej Zeman
|
'''
|
5 |
aba60b70
|
Matej Zeman
|
SQLALCHEMY_DATABASE_URL = "sqlite:///./sql_app.db"
|
6 |
|
|
engine = create_engine(
|
7 |
|
|
SQLALCHEMY_DATABASE_URL, connect_args={"check_same_thread": False}
|
8 |
|
|
)
|
9 |
b49b6e3d
|
Matej Zeman
|
'''
|
10 |
2229e0e1
|
Matej Zeman
|
SQLALCHEMY_DATABASE_URL = "postgresql://postgres:postgres@10.5.0.5:5432/usb_api_db"
|
11 |
ef87a1d2
|
Matej Zeman
|
|
12 |
b49b6e3d
|
Matej Zeman
|
engine = create_engine(
|
13 |
|
|
SQLALCHEMY_DATABASE_URL
|
14 |
|
|
)
|
15 |
ef87a1d2
|
Matej Zeman
|
|
16 |
aba60b70
|
Matej Zeman
|
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
|
17 |
|
|
|
18 |
8fd3d7e5
|
Matej Zeman
|
Base = declarative_base()
|