Enable auxiliary columns for rescore, IVF, and DiskANN indexes

The constructor previously rejected auxiliary columns (+col) for all
non-flat index types. Analysis confirms all code paths already handle
aux columns correctly — aux data lives in _auxiliary shadow table,
independent of the vector index structures.

Remove the three auxiliary column guards. Metadata and partition key
guards remain in place (separate analysis needed).

Adds 8 snapshot-based tests covering shadow table creation, insert+KNN
returning aux values, aux UPDATE, aux DELETE cleanup, and DROP TABLE
for both rescore and DiskANN. IVF aux verified with IVF-enabled build.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alex Garcia 2026-03-31 18:27:02 -07:00
parent 01b4b2a965
commit b7fc459be4
6 changed files with 597 additions and 37 deletions

View file

@ -203,13 +203,15 @@ def test_update_vector_via_delete_insert(db):
# ============================================================================
def test_error_ivf_with_auxiliary_column(db):
result = exec(
db,
"CREATE VIRTUAL TABLE t USING vec0(v float[4] indexed by ivf(), +extra text)",
def test_ivf_with_auxiliary_column(db):
"""IVF should support auxiliary columns."""
db.execute(
"CREATE VIRTUAL TABLE t USING vec0(v float[4] indexed by ivf(), +extra text)"
)
assert "error" in result
assert "auxiliary" in result.get("message", "").lower()
tables = [r[0] for r in db.execute(
"SELECT name FROM sqlite_master WHERE name LIKE 't_%' ORDER BY 1"
).fetchall()]
assert "t_auxiliary" in tables
def test_error_ivf_with_metadata_column(db):