View Source Snowflex (Snowflex v0.5.2)

The client interface for connecting to the Snowflake data warehouse.

The main entry point to this module is Snowflex.sql_query. This function takes a string containing a SQL query and returns a list of maps (one per row). NOTE: due to the way the Erlang ODBC works, all values comeback as strings. You will need to cast values appropriately.

Link to this section Summary

Link to this section Types

Specs

odbc_data_type() ::
  :sql_integer
  | :sql_smallint
  | :sql_tinyint
  | {:sql_decimal, precision(), scale()}
  | {:sql_numeric, precision(), scale()}
  | {:sql_char, size()}
  | {:sql_wchar, size()}
  | {:sql_varchar, size()}
  | {:sql_wvarchar, size()}
  | {:sql_float, precision()}
  | {:sql_wlongvarchar, size()}
  | {:sql_float, precision()}
  | :sql_real
  | :sql_double
  | :sql_bit
  | atom()

Specs

precision() :: integer()

Specs

query_opts() :: [timeout: timeout(), map_nulls_to_nil?: boolean()]

Specs

query_param() :: {odbc_data_type(), [value()]}

Specs

scale() :: integer()

Specs

size() :: integer()

Specs

sql_data() :: [%{optional(String.t()) => String.t()}]

Specs

value() :: nil | term()

Link to this section Functions

Link to this function

cast_results(data, schema)

View Source
Link to this function

param_query(pool_name, query, params, opts)

View Source

Specs

param_query(atom(), String.t(), [query_param()], query_opts()) ::
  sql_data() | {:error, term()} | {:updated, integer()}
Link to this function

sql_query(pool_name, query, opts)

View Source

Specs

sql_query(atom(), String.t(), query_opts()) ::
  sql_data() | {:error, term()} | {:updated, integer()}
Link to this function

string_param(val, length \\ 250)

View Source
Link to this function

unicode_string_param(value)

View Source