unstructured/scripts/sql-test-helpers/create-sqlite-schema.py
rvztz 950e5d68f9
feat: adds postgresql/sqlite destination connector (#2005)
- 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>
2024-01-04 19:33:16 +00:00

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()