from sqlmodel import SQLModel, create_engine, Session

from .settings import get_settings

engine = create_engine(get_settings().SQLDB_URI)


def create_db_and_tables():
    SQLModel.metadata.create_all(engine)


def get_session():
    with Session(engine) as session:
        yield session

sqlmodel.Session sqlmodel.SQLModel.metadata.create_all
[((174, 210), 'sqlmodel.SQLModel.metadata.create_all', 'SQLModel.metadata.create_all', (['engine'], {}), '(engine)\n', (202, 210), False, 'from sqlmodel import SQLModel, create_engine, Session\n'), ((241, 256), 'sqlmodel.Session', 'Session', (['engine'], {}), '(engine)\n', (248, 256), False, 'from sqlmodel import SQLModel, create_engine, Session\n')]