mirror of
https://github.com/PaiGramTeam/sqlmodel.git
synced 2024-12-01 19:28:45 +00:00
11 lines
231 B
Python
11 lines
231 B
Python
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)
|