@echo off
setlocal

set "ROOT_DIR=%~dp0.."
set /p "DB_HOST=Database server IP/name [localhost]: "
if "%DB_HOST%"=="" set "DB_HOST=localhost"
set /p "DB_NAME=Database name [SALECULATOR]: "
if "%DB_NAME%"=="" set "DB_NAME=SALECULATOR"
set /p "DB_USER=Database user [saleculator]: "
if "%DB_USER%"=="" set "DB_USER=saleculator"

powershell -NoProfile -ExecutionPolicy Bypass -File "%ROOT_DIR%\scripts\configure-db.ps1" -Mode test -HostName "%DB_HOST%" -Database "%DB_NAME%" -DbUser "%DB_USER%"
exit /b %ERRORLEVEL%
