mirror of
https://github.com/asg017/sqlite-vec.git
synced 2026-04-25 08:46:49 +02:00
test-case
This commit is contained in:
parent
f55e14cce8
commit
7f47409e60
2 changed files with 24 additions and 2 deletions
|
|
@ -137,12 +137,28 @@ def test_long_text_updates(db, snapshot):
|
|||
)
|
||||
assert vec0_shadow_table_contents(db, "v") == snapshot()
|
||||
INSERT = "insert into v(vector, name) values (?, ?)"
|
||||
assert exec(db, INSERT, [b"\x11\x11\x11\x11", "123456789a12"])
|
||||
assert exec(db, INSERT, [b"\x11\x11\x11\x11", "123456789a123"])
|
||||
exec(db, INSERT, [b"\x11\x11\x11\x11", "123456789a12"])
|
||||
exec(db, INSERT, [b"\x11\x11\x11\x11", "123456789a123"])
|
||||
assert exec(db, "select * from v") == snapshot()
|
||||
assert vec0_shadow_table_contents(db, "v") == snapshot()
|
||||
|
||||
|
||||
def test_long_text_knn(db, snapshot):
|
||||
db.execute(
|
||||
"create virtual table v using vec0(vector float[1], name text, chunk_size=8)"
|
||||
)
|
||||
INSERT = "insert into v(vector, name) values (?, ?)"
|
||||
exec(db, INSERT, [b"\x11\x11\x11\x11", "aaaaaaaaaaaa_aaa"])
|
||||
exec(db, INSERT, [b"\x11\x11\x11\x11", "aaaaaaaaaaaa_bbb"])
|
||||
exec(db, INSERT, [b"\x11\x11\x11\x11", "aaaaaaaaaaaa_ccc"])
|
||||
|
||||
assert exec(
|
||||
db,
|
||||
"select * from v where vector match X'11111111' and k = 5 and name = ?",
|
||||
["aaaaaaaaaaaa_aaa"],
|
||||
) == snapshot(name="knn-eq-true")
|
||||
|
||||
|
||||
def test_types(db, snapshot):
|
||||
db.execute(
|
||||
"create virtual table v using vec0(vector float[1], b boolean, n int, f float, t text, chunk_size=8)"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue