mirror of
https://github.com/stijndcl/didier.git
synced 2026-06-29 17:39:57 +02:00
Restructure backend
This commit is contained in:
parent
16f8fedd16
commit
6ba104758b
16 changed files with 108 additions and 42 deletions
|
|
@ -1,7 +1,7 @@
|
|||
from settings import DB_HOST, DB_NAME, DB_PASSWORD, DB_USERNAME, DB_DIALECT, DB_DRIVER
|
||||
from sqlalchemy import create_engine
|
||||
from sqlalchemy.ext.declarative import declarative_base
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
from sqlalchemy.orm import Session, sessionmaker
|
||||
from urllib.parse import quote_plus
|
||||
|
||||
# Encode password
|
||||
|
|
@ -11,6 +11,6 @@ engine = create_engine(
|
|||
# Format: dialect+driver://username:password@host:port/database
|
||||
f"{DB_DIALECT}{'+' if DB_DRIVER else ''}{DB_DRIVER}://{DB_USERNAME}:{_encoded_pw}@{DB_HOST}/{DB_NAME}"
|
||||
)
|
||||
session = sessionmaker(bind=engine)()
|
||||
session: Session = sessionmaker(bind=engine)()
|
||||
|
||||
Base = declarative_base()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue