Skip to content
Middleware layer for the PrestoDB query engine in Elixir
Elixir Shell Dockerfile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config
lib
scripts
test
.formatter.exs
.gitignore
.travis.yml
Dockerfile
LICENSE
README.md
mix.exs
mix.lock

README.md

Master Hex.pm Version

Prestige

A middleware layer for the Presto database

Documentation: hexdocs

Installation

Prestige can be installed by adding prestige to your list of dependencies in mix.exs:

def deps do
  [
    {:prestige, "~> 0.3.4"}
  ]
end

Running tests

Clone the repo and fetch its dependencies:

$ git clone https://github.com/smartcitiesdata/prestige
$ cd prestige
$ mix deps.get
$ mix test

Example Usage

Adding Data to Presto

Create table:

create_statement = "create table memory.default.monkeys ( id bigint, stuff array(row(name varchar, color varchar)))"
Prestige.execute(create_statement, user: "prestouser") |> Stream.run()

Insert data:

insert_statement = "insert into memory.default.monkeys(id, stuff) values(1, array[row('George','black'), row('James','red')])"
Prestige.execute(insert_statement, user: "prestouser") |> Stream.run()

Select data:

iex> Prestige.execute("select * from memory.default.monkeys", user: "prestouser", by_names: true) |> Prestige.prefetch
[
  %{
    "id" => 1,
    "stuff" => [
      %{"color" => "black", "name" => "George"},
      %{"color" => "red", "name" => "James"}
    ]
  }
]

License

Released under Apache 2 license.

You can’t perform that action at this time.