Spaces:
Sleeping
Sleeping
File size: 346 Bytes
aba90dc | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | import sqlite3, pathlib
DB_PATH = pathlib.Path("company.db")
SCHEMA_FILE = pathlib.Path("schema.sql")
def build_db():
DB_PATH.unlink(missing_ok=True)
with sqlite3.connect(DB_PATH) as conn, open(SCHEMA_FILE) as f:
conn.executescript(f.read())
print("Database created")
if __name__ == "__main__":
build_db()
|