You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
9 lines
293 B
9 lines
293 B
7 months ago
|
import sqlite3
|
||
|
|
||
|
def get_masterdata(db: str, table: str, columns: list[str]) -> list[tuple]:
|
||
|
con = sqlite3.connect(f"./data/masterdata/{db}")
|
||
|
cur = con.cursor()
|
||
|
query = f"select {','.join(columns)} from {table}"
|
||
|
res = cur.execute(query).fetchall()
|
||
|
con.close()
|
||
|
return res
|