killerkiara

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.

First Post! Switch mode

dimitarvp

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

killerkiara

yes, I just tested the actual connection with a Snowflake tool called snowsql that works just like psql and 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

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

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 :slight_smile:

Last Post!

killerkiara

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!

Where Next?

Trending in Questions Top

jonnycharles
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
silverdr
Using Phoenix.LiveView.TagEngine as an EEx.Engine is deprecated! To compile HEEx, use Phoenix.LiveView.TagEngine.compile/2 instead. Sta...
New
saveman71
Hello ! We want new/edit form pages to POST/PUT to their own URL rather than the resources REST defaults (post /things, put /things/:id)...
New
dli
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app? Looking for hints regarding: Addi...
New
bottlenecked
Hi all, I wanted to ask how the community is dealing with post-release steps. Today we have Ecto migrations, which make sure that the db...
New
michallepicki
I am using Oban and occasionally, shortly after a deployment, a handful of jobs can fail because of dependency on other parts of the syst...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
akoutmos
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New

We're in Beta

About us Mission Statement