mirror of
https://github.com/PaiGramTeam/sqlmodel.git
synced 2024-11-27 18:04:04 +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)
|