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.
The SQLite gets confused about uniqueness conditions when deleting and then adding Documents.
This will throw an Exception:
But this works fine:
The other backends (Elastic, Qdrant, Weaviate) have no issues with either of them.