add global state
This commit is contained in:
parent
07964c469e
commit
e37aa36a3e
4 changed files with 30 additions and 20 deletions
|
@ -1,12 +1,11 @@
|
|||
from dataclasses import dataclass
|
||||
from sqlite3 import Cursor
|
||||
|
||||
from .connect import get_connection
|
||||
|
||||
|
||||
def init_db():
|
||||
conn = get_connection()
|
||||
cursor = conn.cursor()
|
||||
cursor.execute("""
|
||||
def init_db(db: Cursor):
|
||||
db.execute("""
|
||||
CREATE TABLE IF NOT EXISTS songs (
|
||||
mbid TEXT PRIMARY KEY,
|
||||
title TEXT NOT NULL,
|
||||
|
@ -16,8 +15,6 @@ def init_db():
|
|||
youtube_id TEXT NOT NULL
|
||||
);
|
||||
""")
|
||||
conn.commit()
|
||||
conn.close()
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue