prestige v2.0.0 Prestige.Case View Source

ExUnit Case that will auto create and drop tables around the entire file and create and rollback transactions around each test.

Example:

defmodule Prestige.CaseTest do
  use Prestige.Case

  session url: "http://localhost:8080", user: "bbalser", catalog: "hive", schema: "default"

  table "people", %{
    "name" => "varchar",
    "age" => "int"
  }

  test "transaction that will be rolled back automatically", %{session: session} do
    Prestige.query!(session, "insert into people(name, age) values('Brian', 21)")

    assert [%{"name" => "Brian"}] == Prestige.query!(session, "select name from people") |> Prestige.Result.as_maps()
  end

end

Link to this section Summary

Link to this section Functions

Link to this macro

table(name, columns)

View Source (macro)