From fe9e23a16a3dffab179cbfbddfb9af62baeb03b4 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Wed, 25 May 2022 10:16:23 +0530 Subject: [PATCH] Add unixodbc if missing in sqlsrv setup --- src/scripts/extensions/sqlsrv.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/scripts/extensions/sqlsrv.sh b/src/scripts/extensions/sqlsrv.sh index 22e6cf43..a3639201 100644 --- a/src/scripts/extensions/sqlsrv.sh +++ b/src/scripts/extensions/sqlsrv.sh @@ -7,9 +7,18 @@ get_sqlsrv_version() { fi } +add_unixodbc() { + if [ "$(uname -s)" = 'Linux' ]; then + install_packages unixodbc-dev + else + brew install unixodbc + fi +} + # Function to install sqlsrv and pdo_sqlsrv. add_sqlsrv() { ext=$1 ext_version=$(get_sqlsrv_version) + add_unixodbc >/dev/null 2>&1 add_pecl_extension "$ext" "$ext_version" extension }