Projekt

Obecné

Profil

Stáhnout (534 Bajtů) Statistiky
| Větev: | Tag: | Revize:
1
from sqlalchemy import create_engine
2
from sqlalchemy.ext.declarative import declarative_base
3
from sqlalchemy.orm import sessionmaker
4

    
5
SQLALCHEMY_DATABASE_URL = "sqlite:///./sql_app.db"
6
engine = create_engine(
7
    SQLALCHEMY_DATABASE_URL, connect_args={"check_same_thread": False}
8
)
9
#SQLALCHEMY_DATABASE_URL = "postgresql://postgres:postgres@localhost:5432/usb_api_db"
10
'''
11
engine = create_engine(
12
    SQLALCHEMY_DATABASE_URL
13
)
14
'''
15
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
16

    
17
Base = declarative_base()
18

    
(3-3/6)