create fastapi
This commit is contained in:
parent
a21dbb08d4
commit
f42e8e4807
6 changed files with 40 additions and 43 deletions
|
|
@ -1,6 +1,6 @@
|
|||
from functools import lru_cache
|
||||
|
||||
from sqlmodel import Field, Session, SQLModel, create_engine, select
|
||||
from sqlmodel import Session, SQLModel, create_engine
|
||||
|
||||
sqlite_file_name = "database.db"
|
||||
sqlite_url = f"sqlite:///{sqlite_file_name}"
|
||||
|
|
@ -8,8 +8,6 @@ sqlite_url = f"sqlite:///{sqlite_file_name}"
|
|||
|
||||
@lru_cache
|
||||
def get_engine():
|
||||
from sqlmodel_base.hero.models import Hero
|
||||
from sqlmodel_base.team.models import Team
|
||||
|
||||
engine = create_engine(sqlite_url)
|
||||
SQLModel.metadata.create_all(engine)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue