Skip to content

Commit

Permalink
Tweak Snowflake ODBC configuration
Browse files Browse the repository at this point in the history
Make the default DSN the same as the Snowflake account name, and make
Snowflake the default driver (though it does not currently work; see
#16 for details). Also update
the versions of SnowSQL and the Snowflake ODBC driver and ensure that only
master or version branch builds get pushed to Docker hub.
  • Loading branch information
theory committed Aug 9, 2019
1 parent 21e47cd commit 1a05fb3
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 14 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ language: bash
services: docker

script:
# DOCKER_USER and $DOCKER_PASS are set in the Travis settings for the project.
- echo "$DOCKER_PASS" | docker login -u "$DOCKER_USER" --password-stdin
- ./build
- \[ "$TRAVIS_PULL_REQUEST" == "false" ] && docker push sqitch/sqitch
# DOCKER_USER and $DOCKER_PASS are set in the Travis settings for the project.
- echo "$DOCKER_PASS" | docker login -u "$DOCKER_USER" --password-stdin
- 'if [[ ( "$TRAVIS_PULL_REQUEST" == "false" ) && ( "$TRAVIS_BRANCH" == "master" || ${TRAVIS_BRANCH:0:1} == "v" ) ]]; then docker push sqitch/sqitch; fi'

after_script:
- docker images
6 changes: 3 additions & 3 deletions snowflake/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ WORKDIR /work
# Download the ODBC driver and SnowSQL.
# https://docs.snowflake.net/manuals/user-guide/snowsql-install-config.html#downloading-the-snowsql-installer
# https://docs.snowflake.net/manuals/release-notes/client-change-log-snowsql.html
ADD https://sfc-snowsql-updates.s3.us-west-2.amazonaws.com/bootstrap/1.1/linux_x86_64/snowsql-1.1.81-linux_x86_64.bash snowsql.bash
ADD https://sfc-snowsql-updates.s3.us-west-2.amazonaws.com/bootstrap/1.1/linux_x86_64/snowsql-1.1.82-linux_x86_64.bash snowsql.bash
# https://sfc-repo.snowflakecomputing.com/index.html
ADD https://sfc-repo.snowflakecomputing.com/odbc/linux/2.19.5/snowflake_linux_x8664_odbc-2.19.5.tgz snowflake_linux_x8664_odbc.tgz
ADD https://sfc-repo.snowflakecomputing.com/odbc/linux/2.19.10/snowflake_linux_x8664_odbc-2.19.10.tgz snowflake_linux_x8664_odbc.tgz
COPY conf ./

# Tell SnowSQL where to store its versions and config. Need to keep it inside
Expand Down Expand Up @@ -48,7 +48,7 @@ RUN apt-get -qq update \
&& printf '#!/bin/sh\n/var/snowsql --config /home/.snowsql/config "$@"\n' > /bin/snowsql \
&& chmod +x /bin/snowsql

# Install SnowSQL plus the ODDB driver and config.
# Install SnowSQL plus the ODBC driver and config.
COPY --from=snow-build /work/snowsql /var/
COPY --from=snow-build --chown=sqitch:sqitch /var/snowsql /var/
COPY --from=snow-build /work/odbc /usr/lib/snowflake/odbc/
Expand Down
10 changes: 8 additions & 2 deletions snowflake/conf/odbc.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
[snowflake]
[ODBC Data Sources]
SF_ACCOUNT = Snowflake DSN for SF_ACCOUNT

[SF_ACCOUNT]
Description=SnowflakeDB
Driver=Snowflake
Driver=/usr/lib/snowflake/odbc/lib/libSnowflake.so
Locale=en-US
SERVER=SF_ACCOUNT.snowflakecomputing.com
PORT=443
SSL=on
ACCOUNT=SF_ACCOUNT

# Sadly does not work: https://github.com/sqitchers/docker-sqitch/pull/16/.
[Default]
Driver=/usr/lib/snowflake/odbc/lib/libSnowflake.so
13 changes: 7 additions & 6 deletions snowflake/conf/odbcinst.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[ODBC Drivers]
Snowflake=Installed

# Sadly does not work: https://github.com/sqitchers/docker-sqitch/pull/16/.
[Default]
Driver=Snowflake

[Snowflake]
APILevel=1
ConnectFunctions=YYY
Description = ODBC for Snowflake
Driver=/usr/lib/snowflake/odbc/lib/libSnowflake.so
DriverODBCVer=03.52
SQLLevel=1

0 comments on commit 1a05fb3

Please sign in to comment.