killerkiara
Connection to Snowflake from Phoenix app
Hello everyone!
This is my first post, I hope I will be able to make it useful to others as well.
I am trying to setup a connection to the cloud analytical DB Snowflake (https://www.snowflake.com/en/) from a Phoenix app using Snowflex (https://github.com/pepsico-ecommerce/snowflex).
I followed the readme on the Snowflex page, but when I run my server locally I keep getting the following error:
[warning] Unable to connect to snowflake: '[Snowflake][ODBC] (10380) Unable to establish connection with data source. Missing settings: {[SERVER]} SQLSTATE IS: 08001 Connection to database failed.'
I am using:
MacOS 12.6 (Apple Silicon M1)
Erlang version 25.1.1, installed with asdf to have ODBC
Elixir version 1.14.2, installed with asdf
Unixodbc 2.3.12 (installed through Homebrew following the Snowflex readme).
This is how my config file looks like for development, with placeholder secrets. I just need to test pushing some data from local for the time being.
config :snowflex, driver: "/opt/snowflake/snowflakeodbc/lib/libSnowflake.dylib"
config :my_app, SnowflakeConnection,
connection: [
server: "snowflake-server-address",
role: "DEV",
warehouse: "name-of-warehouse",
uid: "user",
pwd: "pwd"
]
I have looked extensively, but did not find any similar error for a Phoenix app and I don’t know what to do to fix it.
Trending in Questions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #performance
- #security










First Post!
dimitarvp
It would be easier for readers if you copy-pasted the errors into a code-formatted ``` block and not post screenshot with a tiny font.
That being said, also please post your configuration so potential helpers can try and offer you modifications.
Most Liked
killerkiara
yes, I just tested the actual connection with a Snowflake tool called
snowsqlthat works just likepsqland I can connect without any issue, using the same connection data I am using in my config file. I very much think the issue is in the ODBC setup on my local machine, but I am not being able to debug it as there are so many different pieces that need to work together.Thanks a lot anyways for your time and your suggestions on how to improve my question.
dimitarvp
Highly likely I am afraid. I gave up using ODBC long time ago (more than a decade) but I understand – work is work.
Hope you fix it.
killerkiara
I will share a solution in case I am able to make it work, might help others. I have not found much info anywhere so I collected my courage to write a post here
Last Post!
killerkiara
Hey @pdgonzalez872,
thanks a lot for your reply, I think it is helping more than you could imagine.
There is a lot of insights, especially your thoughts and considerations on ODBC.
As this is not a requirement, I will gladly follow your suggestion and try out a setup using Avalanche.
I had planned to open an issue on the Snowflex repo, it might still be useful for others who cannot choose the non-ODBC route.
Thanks a lot!