porridger/back/db.py

17 lines
660 B
Python

from typing import AsyncGenerator
from sqlalchemy import Column, Integer, String, create_engine, select
# from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker, create_async_engine
from sqlalchemy.orm import sessionmaker, Session
from sqlalchemy.ext.declarative import declarative_base
from fastapi import Depends
# from fastapi_users.db import SQLAlchemyBaseUserTableUUID, SQLAlchemyUserDatabase
SQLALCHEMY_DATABASE_URL = "sqlite:///./sql_app.db"
SessionLocal = sessionmaker(class_='Session', bind=Engine(sqlite:///./sql_app.db), autoflush=True, autocommit=False, expire_on_commit=False)
database = SessionLocal()
Base = declarative_base()