NexBase.Query (nex_base v0.4.3)

Struct representing the intermediate state of a NexBase query.

Summary

Types

explain_opts()

@type explain_opts() :: [
  analyze: boolean(),
  verbose: boolean(),
  settings: boolean(),
  buffers: boolean(),
  wal: boolean(),
  format: :text | :json
]

filter()

@type filter() :: {atom(), atom(), term()}

order_clause()

@type order_clause() :: {:asc | :desc, atom()} | {:asc | :desc, atom(), keyword()}

t()

@type t() :: %NexBase.Query{
  conn: NexBase.Conn.t() | nil,
  count: nil | :exact | :planned | :estimated,
  csv: boolean(),
  data: map() | [map()] | nil,
  default_to_null: boolean(),
  explain_opts: explain_opts() | nil,
  filters: [filter()],
  geojson: boolean(),
  head: boolean(),
  limit: non_neg_integer() | nil,
  limit_referenced_table: String.t() | nil,
  max_affected: non_neg_integer() | nil,
  maybe_single: boolean(),
  not_filters: [filter()],
  offset: non_neg_integer() | nil,
  offset_referenced_table: String.t() | nil,
  or_filters: [[filter()] | {[filter()], [{:referenced_table, String.t()}]}],
  order_by: [
    order_clause() | {order_clause(), [{:referenced_table, String.t()}]}
  ],
  returning: boolean(),
  rollback: boolean(),
  schema: String.t() | nil,
  select: [atom() | String.t()],
  single: boolean(),
  table: String.t() | nil,
  throw_on_error: boolean(),
  type: :select | :insert | :update | :delete | :upsert,
  upsert_opts: upsert_opts()
}

upsert_opts()

@type upsert_opts() :: [
  on_conflict: atom() | [atom()],
  ignore_duplicates: boolean(),
  default_to_null: boolean()
]