imwatsi / hive-plug-play

Customizable block streaming and parsing microservice for custom_json ops on Hive.
MIT License
3 stars 2 forks source link

On first run, expects 'plug_play' database to exist. #2

Closed seakintruth closed 3 years ago

seakintruth commented 3 years ago

--- Hive Plug & Play started --- No database found. Please create a 'plug_play' database in PostgreSQL.

Initial Python script could check if the database exists, if not then create it: from stackoverflow

cursor.execute("SELECT 1 FROM pg_catalog.pg_database WHERE datname = 'python_db'")
exists = cursor.fetchone()
if not exists:
    cursor.execute('CREATE DATABASE python_db')
seakintruth commented 3 years ago

Line 63 of /hive_plug_play/database/setup.py should include an attempt to create the 'plug_play' database

seakintruth commented 3 years ago

Alternatively just add the psql command to create the blank database to the README.md file