pepsico-ecommerce / snowflex

elixir snowflake client
Apache License 2.0
52 stars 10 forks source link

UTF-8 Queries not properly encoded (and this kills the process) #70

Closed andyleclair closed 1 year ago

andyleclair commented 1 year ago

Hi! I'm making some queries with Snowflex and noting this in my Snowflake query console:

image

The query I'm making includes the event name: [OBD-2] Finalizou tutorial do prontuário

I am guessing that there's a missing UTF-8 conversion in the query somewhere?

I have also noticed that making certain queries (try doing one with the first value from this document ) causes the connection to drop entirely and not be recreated

image

From then on, any query will return {:error, [:connection_closed, "No SQL-driver information available"]}

Ch4s3 commented 1 year ago

@andyleclair are you using the latest published version? We're actively working on a 1.0 on a branch that's basically a total rewrite.

andyleclair commented 1 year ago

We were, yes. After looking into it more, the Erlang ODBC docs specify that the query is a list of ASCII characters, so my guess is that's where the real issue lies. https://www.erlang.org/doc/man/odbc.html

I tried a few variations of sending queries to :odbc directly with varying attempts at character coercion from the :unicode module, but no dice there. Maybe I should raise a bug with the Erlang team?

I didn't get anywhere with the process not being restarted, once we discovered this limitation, using ODBC at all was a non-starter for us, as we accept user queries and we need it to work with UTF-8 data. We're using Avalanche now, and it's working well for us.

I'll close this, but probably something people should be aware of?

andyleclair commented 1 year ago

FWIW, Ericsson isn't maintaining the ODBC application (per this ticket ) so, probably not a thing that will get resolved