15 lines
No EOL
385 B
Python
15 lines
No EOL
385 B
Python
from sqlmodel import create_engine, SQLModel
|
|
from src.config import definitions
|
|
import os
|
|
|
|
sqlite_url = definitions.SQLITE_URL
|
|
|
|
|
|
connect_args = {"check_same_thread": False}
|
|
engine = create_engine(sqlite_url, echo=True, connect_args=connect_args)
|
|
|
|
def delete_database():
|
|
os.remove(definitions.DATABASE_FILE_PATH)
|
|
|
|
def create_db_and_tables():
|
|
SQLModel.metadata.create_all(engine) |