mirror of
https://github.com/asg017/sqlite-vec.git
synced 2026-04-29 19:06:32 +02:00
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:
parent
01b4b2a965
commit
b7fc459be4
6 changed files with 597 additions and 37 deletions
|
|
@ -32,15 +32,18 @@ def unpack_float_vec(blob):
|
|||
# ============================================================================
|
||||
|
||||
|
||||
def test_create_error_with_aux_column(db):
|
||||
"""Rescore should reject auxiliary columns."""
|
||||
with pytest.raises(sqlite3.OperationalError, match="Auxiliary columns"):
|
||||
db.execute(
|
||||
"CREATE VIRTUAL TABLE t USING vec0("
|
||||
" embedding float[8] indexed by rescore(quantizer=bit),"
|
||||
" +extra text"
|
||||
")"
|
||||
)
|
||||
def test_create_with_aux_column(db):
|
||||
"""Rescore should support auxiliary columns."""
|
||||
db.execute(
|
||||
"CREATE VIRTUAL TABLE t USING vec0("
|
||||
" embedding float[128] indexed by rescore(quantizer=bit),"
|
||||
" +extra text"
|
||||
")"
|
||||
)
|
||||
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_create_error_with_metadata_column(db):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue