Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Lehre und Unterricht
Datenbank- und Informations-Systeme
DataEngineering
Commits
203e800a
Commit
203e800a
authored
May 08, 2020
by
Marcel Huber
Browse files
added missing functions to execqueries
parent
f8373b37
Changes
3
Hide whitespace changes
Inline
Side-by-side
Indexes/execqueries.sh
View file @
203e800a
...
...
@@ -6,15 +6,10 @@ _EX_NAME="$(basename "${_MY_DIR}")"
test
-z
"
$_EX_DIR
"
&&
_EX_DIR
=
.
_HELPERS_DIR
=
"
$(
realpath
-e
--relative-to
=
.
"
${
_MY_DIR
}
/../Helpers"
)
"
_PARENT_DIR
=
"
$(
cd
"
${
_MY_DIR
}
/.."
&&
pwd
)
"
_WAIT_FOR_IT_LOCATION
=
${
_PARENT_DIR
}
/wait-for-it.sh
_RM_LIST
=
""
_setup_execqueries
()
{
test
-f
"
${
_WAIT_FOR_IT_LOCATION
}
"
||
{
wget
--quiet
-O
"
${
_WAIT_FOR_IT_LOCATION
}
"
https://gitlab.dev.ifs.hsr.ch/ifs/wait-for-it/raw/master/wait-for-it.sh
;
chmod
+x
"
${
_WAIT_FOR_IT_LOCATION
}
"
;
}
test
-f
"
${
_WAIT_FOR_IT_LOCATION
}
"
&&
_RM_LIST
=
"
$_RM_LIST
:
$_WAIT_FOR_IT_LOCATION
"
true
}
_exitproc
()
{
...
...
@@ -114,6 +109,7 @@ for dbtype in MonetDB PostgreSQL; do
_queries_generate_script
=
"
${
_EX_DIR
}
/
${
docname
}
_
${
dbtype
}
.sh"
test
-f
"
$_queries_generate_script
"
||
continue
_queries_file
=
${
_EX_DIR
}
/
${
docname
}
_
${
dbtype
}
.sql
_RM_LIST
=
"
$_RM_LIST
:
$_queries_file
"
_test_date
=
"
$(
date
+%Y%m%d%H%M%S
)
"
_logbase
=
"
${
_EX_DIR
}
/
${
_EX_NAME
}
.
${
dbtype
}
"
_logfile
=
"
${
_logbase
}
.
${
_test_date
}
.log"
...
...
Optimization/execqueries.sh
View file @
203e800a
...
...
@@ -6,6 +6,20 @@ _EX_NAME="$(basename "${_MY_DIR}")"
test
-z
"
$_EX_DIR
"
&&
_EX_DIR
=
.
_HELPERS_DIR
=
"
$(
realpath
-e
--relative-to
=
.
"
${
_MY_DIR
}
/../Helpers"
)
"
_PARENT_DIR
=
"
$(
cd
"
${
_MY_DIR
}
/.."
&&
pwd
)
"
_RM_LIST
=
""
_setup_execqueries
()
{
true
}
_exitproc
()
{
IFS
=
":"
for
f
in
$_RM_LIST
;
do
rm
-f
"
$f
"
done
}
trap
_exitproc INT HUP TERM
db_host
=
postgres
db_name
=
${
1
:-
ds2
}
...
...
@@ -95,6 +109,7 @@ for dbtype in MonetDB PostgreSQL; do
_queries_generate_script
=
"
${
_EX_DIR
}
/
${
docname
}
_
${
dbtype
}
.sh"
test
-f
"
$_queries_generate_script
"
||
continue
_queries_file
=
${
_EX_DIR
}
/
${
docname
}
_
${
dbtype
}
.sql
_RM_LIST
=
"
$_RM_LIST
:
$_queries_file
"
_test_date
=
"
$(
date
+%Y%m%d%H%M%S
)
"
_logbase
=
"
${
_EX_DIR
}
/
${
_EX_NAME
}
.
${
dbtype
}
"
_logfile
=
"
${
_logbase
}
.
${
_test_date
}
.log"
...
...
StoredProcedures/execqueries.sh
View file @
203e800a
...
...
@@ -6,6 +6,20 @@ _EX_NAME="$(basename "${_MY_DIR}")"
test
-z
"
$_EX_DIR
"
&&
_EX_DIR
=
.
_HELPERS_DIR
=
"
$(
realpath
-e
--relative-to
=
.
"
${
_MY_DIR
}
/../Helpers"
)
"
_PARENT_DIR
=
"
$(
cd
"
${
_MY_DIR
}
/.."
&&
pwd
)
"
_RM_LIST
=
""
_setup_execqueries
()
{
true
}
_exitproc
()
{
IFS
=
":"
for
f
in
$_RM_LIST
;
do
rm
-f
"
$f
"
done
}
trap
_exitproc INT HUP TERM
db_host
=
postgres
db_name
=
${
1
:-
bank
}
...
...
@@ -95,6 +109,7 @@ for dbtype in MonetDB PostgreSQL; do
_queries_generate_script
=
"
${
_EX_DIR
}
/
${
docname
}
_
${
dbtype
}
.sh"
test
-f
"
$_queries_generate_script
"
||
continue
_queries_file
=
${
_EX_DIR
}
/
${
docname
}
_
${
dbtype
}
.sql
_RM_LIST
=
"
$_RM_LIST
:
$_queries_file
"
_test_date
=
"
$(
date
+%Y%m%d%H%M%S
)
"
_logbase
=
"
${
_EX_DIR
}
/
${
_EX_NAME
}
.
${
dbtype
}
"
_logfile
=
"
${
_logbase
}
.
${
_test_date
}
.log"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment