Return whether a SQLite table exists in the PaperFlow database.
(table_name: str)
| 90 | |
| 91 | |
| 92 | def table_exists(table_name: str) -> bool: |
| 93 | """Return whether a SQLite table exists in the PaperFlow database.""" |
| 94 | conn = db_ops.get_connection() |
| 95 | row = conn.execute( |
| 96 | "SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = ?", |
| 97 | (table_name,), |
| 98 | ).fetchone() |
| 99 | conn.close() |
| 100 | return row is not None |
| 101 | |
| 102 | |
| 103 | def _vector_to_blob(vector: List[float]) -> bytes: |
no test coverage detected