mirror of
https://github.com/asg017/sqlite-vec.git
synced 2026-04-26 17:26:25 +02:00
test-case
This commit is contained in:
parent
f55e14cce8
commit
7f47409e60
2 changed files with 24 additions and 2 deletions
|
|
@ -617,6 +617,12 @@
|
||||||
]),
|
]),
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
|
# name: test_long_text_knn[knn-eq-true]
|
||||||
|
dict({
|
||||||
|
'error': 'OperationalError',
|
||||||
|
'message': 'Could not filter metadata fields',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
# name: test_long_text_updates
|
# name: test_long_text_updates
|
||||||
dict({
|
dict({
|
||||||
'v_chunks': OrderedDict({
|
'v_chunks': OrderedDict({
|
||||||
|
|
|
||||||
|
|
@ -137,12 +137,28 @@ def test_long_text_updates(db, snapshot):
|
||||||
)
|
)
|
||||||
assert vec0_shadow_table_contents(db, "v") == snapshot()
|
assert vec0_shadow_table_contents(db, "v") == snapshot()
|
||||||
INSERT = "insert into v(vector, name) values (?, ?)"
|
INSERT = "insert into v(vector, name) values (?, ?)"
|
||||||
assert exec(db, INSERT, [b"\x11\x11\x11\x11", "123456789a12"])
|
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", "123456789a123"])
|
||||||
assert exec(db, "select * from v") == snapshot()
|
assert exec(db, "select * from v") == snapshot()
|
||||||
assert vec0_shadow_table_contents(db, "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):
|
def test_types(db, snapshot):
|
||||||
db.execute(
|
db.execute(
|
||||||
"create virtual table v using vec0(vector float[1], b boolean, n int, f float, t text, chunk_size=8)"
|
"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