mirror of
https://github.com/asg017/sqlite-vec.git
synced 2026-04-25 16:56:27 +02:00
block UPDATEs on partition key values for now
This commit is contained in:
parent
21b11e1e83
commit
03f29d581d
3 changed files with 60 additions and 3 deletions
|
|
@ -215,3 +215,31 @@
|
|||
}),
|
||||
})
|
||||
# ---
|
||||
# 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. ',
|
||||
})
|
||||
# ---
|
||||
|
|
|
|||
|
|
@ -53,6 +53,27 @@ def test_types(db, snapshot):
|
|||
)
|
||||
|
||||
|
||||
def test_updates(db, snapshot):
|
||||
db.execute(
|
||||
"create virtual table v using vec0(p text partition key, a float[1], chunk_size=8)"
|
||||
)
|
||||
|
||||
db.execute(
|
||||
"insert into v(rowid, p, a) values (?, ?, ?)", [1, "a", b"\x11\x11\x11\x11"]
|
||||
)
|
||||
db.execute(
|
||||
"insert into v(rowid, p, a) values (?, ?, ?)", [2, "a", b"\x22\x22\x22\x22"]
|
||||
)
|
||||
db.execute(
|
||||
"insert into v(rowid, p, a) values (?, ?, ?)", [3, "a", b"\x33\x33\x33\x33"]
|
||||
)
|
||||
|
||||
assert exec(db, "select * from v") == snapshot(name="1. Initial dataset")
|
||||
assert exec(db, "update v set p = ? where rowid = ?", ["new", 1]) == snapshot(
|
||||
name="2. update #1"
|
||||
)
|
||||
|
||||
|
||||
class Row:
|
||||
def __init__(self):
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue