aprs_tool/init_db.py

20 lines
484 B
Python
Raw Normal View History

2023-04-13 20:46:28 -05:00
import sqlite3
connection = sqlite3.connect('database.db')
with open('schema.sql') as f:
connection.executescript(f.read())
cur = connection.cursor()
# cur.execute("INSERT INTO posts (title, content) VALUES (?, ?)",
# ('First Post', 'Content for the first post')
# )
#
# cur.execute("INSERT INTO posts (title, content) VALUES (?, ?)",
# ('Second Post', 'Content for the second post')
# )
connection.commit()
connection.close()