prestige v0.3.3 Prestige View Source

An elixir client for Prestodb.

Link to this section Summary

Functions

Executes a prepared statement against presto, returns a stream

Converts a presto stream into a map for consumption

Link to this section Functions

Link to this function

execute(statement, opts \\ []) View Source

Executes a prepared statement against presto, returns a stream

Options:

  • :rows_as_maps - converts response to a list of maps, with the column name as the key and the row data as the value

All other specified options are passed directly to presto as headers, a full list of those headers can be found here.

Examples

iex> Prestige.execute("select * from users") |> Prestige.prefetch
[[1, "Brian"], [2, "Shannon"]]

iex> Prestige.execute("select * from users", rows_as_maps: true) |> Prestige.prefetch
[%{"id" => 1, "name" => "Brian"}, %{"id" => 2, "name" => "Shannon"}]

Converts a presto stream into a map for consumption