2021-05-25 16:54:18 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
PARAMS=""
|
2021-06-09 12:50:02 +03:00
|
|
|
BACKEND="${BACKEND:-postgres}"
|
2021-05-25 16:54:18 +03:00
|
|
|
|
|
|
|
die_backends() {
|
|
|
|
cat <<EOL
|
|
|
|
Invalid --backend argument. Available backends:
|
|
|
|
postgres (default)
|
|
|
|
bigquery
|
|
|
|
citus
|
|
|
|
mssql
|
2021-07-21 20:22:08 +03:00
|
|
|
mysql
|
2021-05-25 16:54:18 +03:00
|
|
|
|
|
|
|
EOL
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
while (( "$#" )); do
|
|
|
|
case "$1" in
|
|
|
|
--backend)
|
|
|
|
if [ -n "$2" ] && [ "${2:0:1}" != "-" ]; then
|
|
|
|
BACKEND=$2
|
|
|
|
shift 2
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
*) # preserve positional arguments
|
|
|
|
PARAMS="$PARAMS $1"
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
# validate backend argument
|
|
|
|
case "$BACKEND" in
|
|
|
|
postgres)
|
|
|
|
;;
|
|
|
|
bigquery)
|
2022-01-25 11:26:32 +03:00
|
|
|
source "scripts/bigquery.sh"
|
2021-07-06 14:12:18 +03:00
|
|
|
|
2021-08-12 19:47:33 +03:00
|
|
|
verify_bigquery_pytest_env
|
2021-05-25 16:54:18 +03:00
|
|
|
;;
|
|
|
|
citus)
|
|
|
|
;;
|
|
|
|
mssql)
|
|
|
|
;;
|
2021-07-21 20:22:08 +03:00
|
|
|
mysql)
|
|
|
|
;;
|
2021-05-25 16:54:18 +03:00
|
|
|
*)
|
|
|
|
die_backends
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# set positional arguments in their proper place
|
|
|
|
eval set -- "$PARAMS"
|
|
|
|
export BACKEND
|