from sqlmodel import SQLModel, create_engine

sqlite_file_name = "database.db"
sqlite_url = f"sqlite:///{sqlite_file_name}"

engine = create_engine(sqlite_url)


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

sqlmodel.create_engine sqlmodel.SQLModel.metadata.create_all
[((134, 159), 'sqlmodel.create_engine', 'create_engine', (['sqlite_url'], {}), '(sqlite_url)\n', (147, 159), False, 'from sqlmodel import SQLModel, create_engine\n'), ((194, 230), 'sqlmodel.SQLModel.metadata.create_all', 'SQLModel.metadata.create_all', (['engine'], {}), '(engine)\n', (222, 230), False, 'from sqlmodel import SQLModel, create_engine\n')]