View Source AyeSQL.AST.Context (AyeSQL v1.1.3)
This module defines an AST context.
Summary
Functions
AST context struct.
Adds a value to the context index.
Context id function.
Merges two contexts.
Merges a context with an error
Merges a context with a query.
Creates a new context given some options.
Updates context with the error not found for a key.
Adds arguments in a context given a new value.
Adds statement in a context given a new value.
Puts a new variable value in the context.
Puts several variable value in the context as an SQL list.
Transforms a context to a query.
Types
@type arguments() :: [term()]
Argument list.
@type error() :: {AyeSQL.Core.parameter_name(), error_type()}
Error.
@type error_type() :: :not_found
Error type.
@type index() :: non_neg_integer()
Current context index.
@type statement() :: [binary()]
Accumulated statement.
@type t() :: %AyeSQL.AST.Context{ arguments: arguments :: arguments(), errors: errors :: [error()], index: index :: index(), statement: statement :: statement() }
AST context.
Functions
AST context struct.
@spec add_index(t(), non_neg_integer()) :: t()
Adds a value to the context index.
Context id function.
Merges two contexts.
@spec merge_error(t(), AyeSQL.Error.t()) :: t()
Merges a context with an error
@spec merge_query(t(), AyeSQL.Query.t()) :: t()
Merges a context with a query.
Creates a new context given some options.
@spec not_found(t(), AyeSQL.Core.parameter_name()) :: t()
Updates context with the error not found for a key.
Adds arguments in a context given a new value.
Adds statement in a context given a new value.
Puts a new variable value in the context.
Puts several variable value in the context as an SQL list.
@spec to_query(t()) :: {:ok, AyeSQL.Query.t()} | {:error, AyeSQL.Error.t()}
Transforms a context to a query.