23 lines
358 B
Python
23 lines
358 B
Python
import os
|
|
import sqlite3
|
|
|
|
import config
|
|
|
|
os.makedirs(config.db_dir, exist_ok=True)
|
|
connection = sqlite3.connect(config.db_file)
|
|
cursor = connection.cursor()
|
|
|
|
cursor.execute(
|
|
"""
|
|
CREATE TABLE IF NOT EXISTS puzzle(
|
|
number INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
author TEXT,
|
|
creation_date TEXT,
|
|
data CLOB
|
|
)
|
|
"""
|
|
)
|
|
|
|
connection.commit()
|
|
connection.close()
|