mirror of
https://github.com/asg017/sqlite-vec.git
synced 2026-04-25 08:46:49 +02:00
245 lines
7.1 KiB
Text
245 lines
7.1 KiB
Text
# serializer version: 1
|
|
# name: test_constructor_limit[max 4 partition keys]
|
|
dict({
|
|
'error': 'OperationalError',
|
|
'message': 'vec0 constructor error: More than 4 partition key columns were provided',
|
|
})
|
|
# ---
|
|
# name: test_normal[1 row]
|
|
dict({
|
|
'v_chunks': OrderedDict({
|
|
'sql': 'select * from v_chunks',
|
|
'rows': list([
|
|
OrderedDict({
|
|
'chunk_id': 1,
|
|
'size': 8,
|
|
'sequence_id': None,
|
|
'partition00': 100,
|
|
'validity': b'\x01',
|
|
'rowids': b'\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
|
}),
|
|
]),
|
|
}),
|
|
'v_rowids': OrderedDict({
|
|
'sql': 'select * from v_rowids',
|
|
'rows': list([
|
|
OrderedDict({
|
|
'rowid': 1,
|
|
'id': None,
|
|
'chunk_id': 1,
|
|
'chunk_offset': 0,
|
|
}),
|
|
]),
|
|
}),
|
|
'v_vector_chunks00': OrderedDict({
|
|
'sql': 'select * from v_vector_chunks00',
|
|
'rows': list([
|
|
OrderedDict({
|
|
'rowid': 1,
|
|
'vectors': b'\x11"3D\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
|
}),
|
|
]),
|
|
}),
|
|
})
|
|
# ---
|
|
# name: test_normal[2 rows, same parition]
|
|
dict({
|
|
'v_chunks': OrderedDict({
|
|
'sql': 'select * from v_chunks',
|
|
'rows': list([
|
|
OrderedDict({
|
|
'chunk_id': 1,
|
|
'size': 8,
|
|
'sequence_id': None,
|
|
'partition00': 100,
|
|
'validity': b'\x03',
|
|
'rowids': b'\x01\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
|
}),
|
|
]),
|
|
}),
|
|
'v_rowids': OrderedDict({
|
|
'sql': 'select * from v_rowids',
|
|
'rows': list([
|
|
OrderedDict({
|
|
'rowid': 1,
|
|
'id': None,
|
|
'chunk_id': 1,
|
|
'chunk_offset': 0,
|
|
}),
|
|
OrderedDict({
|
|
'rowid': 2,
|
|
'id': None,
|
|
'chunk_id': 1,
|
|
'chunk_offset': 1,
|
|
}),
|
|
]),
|
|
}),
|
|
'v_vector_chunks00': OrderedDict({
|
|
'sql': 'select * from v_vector_chunks00',
|
|
'rows': list([
|
|
OrderedDict({
|
|
'rowid': 1,
|
|
'vectors': b'\x11"3DDUfw\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
|
}),
|
|
]),
|
|
}),
|
|
})
|
|
# ---
|
|
# name: test_normal[3 rows, 2 partitions]
|
|
dict({
|
|
'v_chunks': OrderedDict({
|
|
'sql': 'select * from v_chunks',
|
|
'rows': list([
|
|
OrderedDict({
|
|
'chunk_id': 1,
|
|
'size': 8,
|
|
'sequence_id': None,
|
|
'partition00': 100,
|
|
'validity': b'\x03',
|
|
'rowids': b'\x01\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
|
}),
|
|
OrderedDict({
|
|
'chunk_id': 2,
|
|
'size': 8,
|
|
'sequence_id': None,
|
|
'partition00': 200,
|
|
'validity': b'\x01',
|
|
'rowids': b'\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
|
}),
|
|
]),
|
|
}),
|
|
'v_rowids': OrderedDict({
|
|
'sql': 'select * from v_rowids',
|
|
'rows': list([
|
|
OrderedDict({
|
|
'rowid': 1,
|
|
'id': None,
|
|
'chunk_id': 1,
|
|
'chunk_offset': 0,
|
|
}),
|
|
OrderedDict({
|
|
'rowid': 2,
|
|
'id': None,
|
|
'chunk_id': 1,
|
|
'chunk_offset': 1,
|
|
}),
|
|
OrderedDict({
|
|
'rowid': 3,
|
|
'id': None,
|
|
'chunk_id': 2,
|
|
'chunk_offset': 0,
|
|
}),
|
|
]),
|
|
}),
|
|
'v_vector_chunks00': OrderedDict({
|
|
'sql': 'select * from v_vector_chunks00',
|
|
'rows': list([
|
|
OrderedDict({
|
|
'rowid': 1,
|
|
'vectors': b'\x11"3DDUfw\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
|
}),
|
|
OrderedDict({
|
|
'rowid': 2,
|
|
'vectors': b'\x88\x99\xaa\xbb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
|
}),
|
|
]),
|
|
}),
|
|
})
|
|
# ---
|
|
# name: test_types[1. raises type error]
|
|
dict({
|
|
'error': 'OperationalError',
|
|
'message': 'Parition key type mismatch: The partition key column p1 has type INTEGER, but TEXT was provided.',
|
|
})
|
|
# ---
|
|
# name: test_types[2. empty DB]
|
|
dict({
|
|
'v_chunks': OrderedDict({
|
|
'sql': 'select * from v_chunks',
|
|
'rows': list([
|
|
]),
|
|
}),
|
|
'v_rowids': OrderedDict({
|
|
'sql': 'select * from v_rowids',
|
|
'rows': list([
|
|
]),
|
|
}),
|
|
'v_vector_chunks00': OrderedDict({
|
|
'sql': 'select * from v_vector_chunks00',
|
|
'rows': list([
|
|
]),
|
|
}),
|
|
})
|
|
# ---
|
|
# name: test_types[3. allow nulls]
|
|
OrderedDict({
|
|
'sql': 'insert into v(p1, a) values(?, ?)',
|
|
'rows': list([
|
|
]),
|
|
})
|
|
# ---
|
|
# name: test_types[4. show NULL partition key]
|
|
dict({
|
|
'v_chunks': OrderedDict({
|
|
'sql': 'select * from v_chunks',
|
|
'rows': list([
|
|
OrderedDict({
|
|
'chunk_id': 1,
|
|
'size': 8,
|
|
'sequence_id': None,
|
|
'partition00': None,
|
|
'validity': b'\x01',
|
|
'rowids': b'\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
|
}),
|
|
]),
|
|
}),
|
|
'v_rowids': OrderedDict({
|
|
'sql': 'select * from v_rowids',
|
|
'rows': list([
|
|
OrderedDict({
|
|
'rowid': 1,
|
|
'id': None,
|
|
'chunk_id': 1,
|
|
'chunk_offset': 0,
|
|
}),
|
|
]),
|
|
}),
|
|
'v_vector_chunks00': OrderedDict({
|
|
'sql': 'select * from v_vector_chunks00',
|
|
'rows': list([
|
|
OrderedDict({
|
|
'rowid': 1,
|
|
'vectors': b'\x11"3D\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
|
}),
|
|
]),
|
|
}),
|
|
})
|
|
# ---
|
|
# name: test_updates[1. Initial dataset]
|
|
OrderedDict({
|
|
'sql': 'select * from v',
|
|
'rows': list([
|
|
OrderedDict({
|
|
'rowid': 1,
|
|
'p': 'a',
|
|
'a': b'\x11\x11\x11\x11',
|
|
}),
|
|
OrderedDict({
|
|
'rowid': 2,
|
|
'p': 'a',
|
|
'a': b'""""',
|
|
}),
|
|
OrderedDict({
|
|
'rowid': 3,
|
|
'p': 'a',
|
|
'a': b'3333',
|
|
}),
|
|
]),
|
|
})
|
|
# ---
|
|
# name: test_updates[2. update #1]
|
|
dict({
|
|
'error': 'OperationalError',
|
|
'message': 'UPDATE on partition key columns are not supported yet. ',
|
|
})
|
|
# ---
|