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>
21 lines
509 B
Bash
Executable File
21 lines
509 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
SCRIPT_DIR=$(dirname "$(realpath "$0")")
|
|
DATABASE_NAME=$1
|
|
DATABASE_FILE_PATH=$2
|
|
|
|
# Create the SQL instance
|
|
if [[ "$DATABASE_NAME" != "sqlite" ]]; then
|
|
docker compose version
|
|
docker compose -f "$SCRIPT_DIR"/docker-compose-"$DATABASE_NAME".yaml up --wait
|
|
docker compose -f "$SCRIPT_DIR"/docker-compose-"$DATABASE_NAME".yaml ps
|
|
else
|
|
touch "$DATABASE_FILE_PATH"
|
|
|
|
python "$SCRIPT_DIR"/create-sqlite-schema.py "$DATABASE_FILE_PATH"
|
|
fi
|
|
|
|
echo "$DATABASE_NAME instance is live."
|