mirror of
https://github.com/Unstructured-IO/unstructured.git
synced 2025-06-27 02:30:08 +00:00

- Adds a destination connector to upload processed output into a PostgreSQL/Sqlite database instance. - Users are responsible to provide their instances. This PR includes a couple of configuration examples. - Defines the scripts required to setup a PostgreSQL instance with the unstructured elements schema. - Validates postgres/pgvector embedding storage and retrieval --------- Co-authored-by: potter-potter <david.potter@gmail.com>
15 lines
385 B
Python
15 lines
385 B
Python
import sqlite3
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
if __name__ == "__main__":
|
|
connection = sqlite3.connect(database=sys.argv[1])
|
|
|
|
query = None
|
|
script_path = (Path(__file__).parent / Path("create-sqlite-schema.sql")).resolve()
|
|
with open(script_path) as f:
|
|
query = f.read()
|
|
cursor = connection.cursor()
|
|
cursor.executescript(query)
|
|
connection.close()
|