#!/bin/sh

EXAMPLE_DIRECTORY=$1
DATABASE=$2

RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m' # No Color

echo "${GREEN}\nLets assume that we want to load each 7-th day's date from 1990 year to 'dates' table at our database...${NC}"
echo "${GREEN}\nTo do this we prepare next 'job.xml' file:${NC}"
cat $EXAMPLE_DIRECTORY/job.xml

echo "${GREEN}\nRunning this job with our etl tool...${NC}"
bin/bisight etl:run $EXAMPLE_DIRECTORY/job.xml dbname=$DATABASE

echo "${GREEN}\nThis job have created table 'dates' with all proper fields.${NC}"
echo "${GREEN}\nNow we have all our dates in table 'dates':${NC}"
mysql -u root -e "select * from $DATABASE.dates;"
