Rename a directory, need to store the db file in a directory.

This commit is contained in:
2023-08-26 21:36:18 -04:00
parent 2991f81e04
commit f6e827fba5
7 changed files with 8 additions and 8 deletions
+15
View File
@@ -0,0 +1,15 @@
"""
Small script to create the database if it doesn't already exist.
"""
import sqlite3
from os.path import exists
if not exists("database/dakiny.db"):
with sqlite3.connect("database/dakiny.db") as con:
cur = con.cursor()
with open("database_setup/database.sql", mode="r", encoding="utf-8") as file:
database_script = file.read()
cur.executescript(database_script)
con.commit()