mirror of
https://github.com/asg017/sqlite-vec.git
synced 2026-04-25 00:36:56 +02:00
Auxiliary column support (#123)
* initial pass at PARTITION KEY support. * Initial pass, allow auxiliary columns on vec0 virtual tables * update TODO * unit tests * gha this PR branch * fixup tests * doc internal * fix tests, KNN/rowids in * define SQLITE_INDEX_CONSTRAINT_OFFSET * whoops * update tests, syrupy, use uv * un ignore pyproject.toml * dot * tests/ * type error? * win: .exe, update error name * try fix macos python, paren around expr? * win bash? * dbg :( * explicit error * op * dbg win * win ./tests/.venv/Scripts/python.exe * block UPDATEs on partition key values for now * test this branch * accidentally removved "partition key type mistmatch" block during merge * typo ugh * bruv * start aux snapshots * drop aux shadow table on destroy * enforce column types * block WHERE constraints on auxiliary columns in KNN queries * support delete * support UPDATE on auxiliary columns
This commit is contained in:
parent
6658624172
commit
9bfeaa7842
6 changed files with 1249 additions and 8 deletions
21
test.sql
21
test.sql
|
|
@ -1,9 +1,30 @@
|
|||
|
||||
.load dist/vec0
|
||||
.echo on
|
||||
.bail on
|
||||
|
||||
.mode qbox
|
||||
|
||||
create virtual table vec_chunks using vec0(
|
||||
chunk_id integer primary key,
|
||||
contents_embedding float[1],
|
||||
+contents text
|
||||
);
|
||||
insert into vec_chunks(chunk_id, contents_embedding, contents) values
|
||||
(1, '[1]', 'alex'),
|
||||
(2, '[2]', 'brian'),
|
||||
(3, '[3]', 'craig'),
|
||||
(4, '[4]', 'dylan');
|
||||
|
||||
select * from vec_chunks;
|
||||
|
||||
select chunk_id, contents, distance
|
||||
from vec_chunks
|
||||
where contents_embedding match '[5]'
|
||||
and k = 3;
|
||||
|
||||
.exit
|
||||
|
||||
create virtual table v using vec0(a float[1]);
|
||||
select count(*) from v_chunks;
|
||||
insert into v(a) values ('[1.11]');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue