Use basedpyright refactor
This commit is contained in:
@@ -1,23 +1,15 @@
|
||||
from typing import Optional
|
||||
|
||||
from folkugat_web import data
|
||||
from folkugat_web.dal.sql import Connection, get_connection
|
||||
|
||||
from .write import insert_tema
|
||||
|
||||
|
||||
def create_db(con: Optional[Connection] = None):
|
||||
def create_db(con: Connection | None = None):
|
||||
with get_connection(con) as con:
|
||||
create_temes_table(con)
|
||||
|
||||
# for tema in data.TEMES:
|
||||
# insert_tema(tema, con)
|
||||
|
||||
|
||||
def drop_temes_table(con: Connection):
|
||||
query = "DROP TABLE IF EXISTS temes"
|
||||
cur = con.cursor()
|
||||
cur.execute(query)
|
||||
_ = cur.execute(query)
|
||||
|
||||
|
||||
def create_temes_table(con: Connection):
|
||||
@@ -36,4 +28,4 @@ def create_temes_table(con: Connection):
|
||||
)
|
||||
"""
|
||||
cur = con.cursor()
|
||||
cur.execute(query)
|
||||
_ = cur.execute(query)
|
||||
|
||||
Reference in New Issue
Block a user