View Source Unreal.Writer.Select (Unreal v0.2.0)

Query builder for select operation.

alias Unreal.Writer

Writer.Select.init()
|> Writer.Select.from("users")
|> Writer.Select.where(age: {:>, 18})
|> Writer.Select.get([:username, :age])
|> Writer.Select.build()

Or

alias Unreal.Writer

Writer.Select.init("users", [:username, :age], age: {:>, 18})
|> Writer.Select.build()

Link to this section Summary

Link to this section Types

@type t() :: %Unreal.Writer.Select{
  from: String.t(),
  params: map(),
  values: String.t(),
  where: String.t()
}

Link to this section Functions

@spec build(t()) :: {String.t(), map()}
@spec from(t(), String.t()) :: t()
@spec get(t(), any()) :: t()
@spec init() :: t()
@spec init(String.t()) :: t()
@spec init(String.t(), String.t() | [atom()]) :: t()
Link to this function

init(table, values, matches)

View Source
@spec init(String.t(), String.t() | [atom()], keyword()) :: t()
@spec where(
  t(),
  keyword()
) :: t()