mirror of
https://github.com/asg017/sqlite-vec.git
synced 2026-04-26 01:06:27 +02:00
21 lines
387 B
MySQL
21 lines
387 B
MySQL
|
|
.load dist/vec0
|
||
|
|
|
||
|
|
|
||
|
|
create virtual table vec_items using vec0(
|
||
|
|
vector float[1]
|
||
|
|
);
|
||
|
|
|
||
|
|
insert into vec_items(rowid, vector)
|
||
|
|
select value, json_array(value) from generate_series(1, 100);
|
||
|
|
|
||
|
|
|
||
|
|
select vec_to_json(vector), distance
|
||
|
|
from vec_items
|
||
|
|
where vector match '[1]'
|
||
|
|
and k = 5;
|
||
|
|
|
||
|
|
select vec_to_json(vector), distance
|
||
|
|
from vec_items
|
||
|
|
where vector match '[1]'
|
||
|
|
and k = 5
|
||
|
|
and distance > 4.0;
|