mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 17:31:56 +03:00
b844c5d732
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3914 GitOrigin-RevId: 66f75420504d1b864b91599c2bdaa832784bb956
56 lines
770 B
Bash
56 lines
770 B
Bash
#!/usr/bin/env bash
|
|
PARAMS=""
|
|
BACKEND="${BACKEND:-postgres}"
|
|
|
|
die_backends() {
|
|
cat <<EOL
|
|
Invalid --backend argument. Available backends:
|
|
postgres (default)
|
|
bigquery
|
|
citus
|
|
mssql
|
|
mysql
|
|
|
|
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)
|
|
source "scripts/bigquery.sh"
|
|
|
|
verify_bigquery_pytest_env
|
|
;;
|
|
citus)
|
|
;;
|
|
mssql)
|
|
;;
|
|
mysql)
|
|
;;
|
|
*)
|
|
die_backends
|
|
;;
|
|
esac
|
|
|
|
# set positional arguments in their proper place
|
|
eval set -- "$PARAMS"
|
|
export BACKEND
|