Packages

An Elixir interface to the libpg_query postgres query parser. Converts a valid PostgreSQL query into a Protobuf based AST.

Current section

Files

Jump to
pg_query_ex lib pg_query proto pg_query_set_operation.ex
Raw

lib/pg_query/proto/pg_query_set_operation.ex

# Code generated by protox. Don't edit.
# credo:disable-for-this-file
defmodule PgQuery.SetOperation do
@moduledoc false
@type t :: %__MODULE__{}
defstruct []
(
@spec default() :: :SET_OPERATION_UNDEFINED
def default() do
:SET_OPERATION_UNDEFINED
end
)
@spec encode(atom() | String.t()) :: integer() | atom()
def encode(:SET_OPERATION_UNDEFINED) do
0
end
def encode(:SETOP_NONE) do
1
end
def encode(:SETOP_UNION) do
2
end
def encode(:SETOP_INTERSECT) do
3
end
def encode(:SETOP_EXCEPT) do
4
end
def encode(x) do
x
end
@spec decode(integer()) :: atom() | integer()
def decode(0) do
:SET_OPERATION_UNDEFINED
end
def decode(1) do
:SETOP_NONE
end
def decode(2) do
:SETOP_UNION
end
def decode(3) do
:SETOP_INTERSECT
end
def decode(4) do
:SETOP_EXCEPT
end
def decode(x) do
x
end
@spec constants() :: [{integer(), atom()}]
def constants() do
[
{0, :SET_OPERATION_UNDEFINED},
{1, :SETOP_NONE},
{2, :SETOP_UNION},
{3, :SETOP_INTERSECT},
{4, :SETOP_EXCEPT}
]
end
@spec has_constant?(any()) :: boolean()
(
def has_constant?(:SET_OPERATION_UNDEFINED) do
true
end
def has_constant?(:SETOP_NONE) do
true
end
def has_constant?(:SETOP_UNION) do
true
end
def has_constant?(:SETOP_INTERSECT) do
true
end
def has_constant?(:SETOP_EXCEPT) do
true
end
def has_constant?(_) do
false
end
)
end