20 lines
742 B
Python
20 lines
742 B
Python
"""Collection mapping helpers for the workspace semantic store."""
|
|
|
|
# kind Thoth → tabella dello schema `vectors`.
|
|
KIND_TO_TABLE = {
|
|
"schema_table": "schema_records",
|
|
"schema_column": "schema_records",
|
|
"evidence": "evidence",
|
|
"memory": "memory",
|
|
"solved_question": "memory", # coppie domanda->SQL: stessa tabella, kind dedicato
|
|
}
|
|
ALL_TABLES = ["schema_records", "evidence", "memory"]
|
|
|
|
|
|
def tables_for_kinds(kinds: list[str] | None) -> list[str]:
|
|
"""Tabelle da interrogare per i kind richiesti (tutte se kinds è vuoto/None)."""
|
|
if not kinds:
|
|
return list(ALL_TABLES)
|
|
return sorted({KIND_TO_TABLE[k] for k in kinds if k in KIND_TO_TABLE})
|
|
__all__ = ["ALL_TABLES", "KIND_TO_TABLE", "tables_for_kinds"]
|