use uniqueness for complete db check
This commit is contained in:
parent
65cd55ec0a
commit
85698c377b
1 changed files with 4 additions and 0 deletions
|
|
@ -26,6 +26,10 @@ def are_keys_unique(db: Path, table: str, col: str) -> bool:
|
||||||
|
|
||||||
def check_db_integrity(path: Path) -> None:
|
def check_db_integrity(path: Path) -> None:
|
||||||
db = get_db_file(path)
|
db = get_db_file(path)
|
||||||
|
|
||||||
|
if not are_keys_unique(db, 'backlogs', 'path'):
|
||||||
|
raise Exception("The paths the backlog table of the database links are not unique.")
|
||||||
|
|
||||||
search_expr = "SELECT * FROM 'backlogs'"
|
search_expr = "SELECT * FROM 'backlogs'"
|
||||||
conn = sqlite3.connect(db)
|
conn = sqlite3.connect(db)
|
||||||
results = pd.read_sql(search_expr, conn)
|
results = pd.read_sql(search_expr, conn)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue