Skip to content

Bug: SQLite document store doesn't handle delete-then-insert properly #470

Description

@JohannesMessner

The SQLite gets confused about uniqueness conditions when deleting and then adding Documents.
This will throw an Exception:

da = DocumentArray(storage='sqlite')

with da:
    da.extend([Document(id=str(i)) for i in range(3)])
with da:
    del da[1]
    da.append(Document(id='new'))

for d in da:
    print(d.id)

But this works fine:

da = DocumentArray(storage='sqlite')

with da:
    da.extend([Document(id=str(i)) for i in range(3)])
with da:
    del da[1]

with da:
    da.append(Document(id='new'))

for d in da:
    print(d.id)

The other backends (Elastic, Qdrant, Weaviate) have no issues with either of them.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions