mirror of
https://github.com/asg017/sqlite-vec.git
synced 2026-04-25 08:46:49 +02:00
Deduplicates exec(), vec0_shadow_table_contents(), _f32(), _i64(), and _int8() helpers that were copied across six test files. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
29 lines
894 B
Python
29 lines
894 B
Python
import sqlite3
|
|
import pytest
|
|
from helpers import exec
|
|
|
|
|
|
@pytest.mark.skipif(
|
|
sqlite3.sqlite_version_info[1] < 37,
|
|
reason="pragma_table_list was added in SQLite 3.37",
|
|
)
|
|
def test_shadow(db, snapshot):
|
|
db.execute(
|
|
"create virtual table v using vec0(a float[1], partition text partition key, metadata text, +name text, chunk_size=8)"
|
|
)
|
|
assert exec(db, "select * from sqlite_master order by name") == snapshot()
|
|
assert (
|
|
exec(db, "select * from pragma_table_list where type = 'shadow' order by name") == snapshot()
|
|
)
|
|
|
|
db.execute("drop table v;")
|
|
assert (
|
|
exec(db, "select * from pragma_table_list where type = 'shadow' order by name") == snapshot()
|
|
)
|
|
|
|
|
|
def test_info(db, snapshot):
|
|
db.execute("create virtual table v using vec0(a float[1])")
|
|
assert exec(db, "select key, typeof(value) from v_info order by 1") == snapshot()
|
|
|
|
|