Skip to content

Commit ee551ec

Browse files
Import interface after closing database (#13)
1 parent be8ab98 commit ee551ec

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

lib/sql.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,6 @@ Sql__open() {
3838
# Shuts down the database
3939
#################################################
4040
Sql__close() {
41+
. "$Sql__PACKAGE_LOCATION/lib/drivers/interface.sh"
4142
Sql_driver_close
4243
}

test.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,14 @@ Sql_test_generic_open() {
115115
echo "'Sql__close' returned an error"
116116
return 1
117117
fi
118+
119+
# Test connection
120+
local ping_output
121+
ping_output=$(Sql__ping)
122+
if [[ $? -eq 0 ]]; then
123+
echo "Database not closed properly, can still ping the database after closing"
124+
return 1
125+
fi
118126
}
119127

120128
#################################################

0 commit comments

Comments
 (0)