mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-07-29 03:39:58 +00:00
11 lines
486 B
Python
11 lines
486 B
Python
from haystack.database.sql import SQLDocumentStore
|
|
from haystack.indexing.io import write_documents_to_db
|
|
|
|
|
|
def test_db_write_read():
|
|
sql_datastore = SQLDocumentStore()
|
|
write_documents_to_db(datastore=sql_datastore, document_dir="samples/docs")
|
|
documents = sql_datastore.get_all_documents()
|
|
assert len(documents) == 2
|
|
assert documents[0]["text"] == 'A Doc specifically talking about haystack.\nHaystack can be used to scale QA models to large document collections.'
|