View Source AyeSQL.Compiler (AyeSQL v1.1.2)

This module defines functions to compile AyeSQL language strings.

Summary

Types

Query documentation.

Query fragment.

Query fragments.

Query name.

Query parameter.

Queries.

Query.

Functions

Compiles the contents of a file or string into valid AyeSQL queries.

Compiles a single query from the contents of a string.

Evaluates the contents of a string to an anonymous function with a query that receives parameters and options.

Types

@type docs() :: nil | binary()

Query documentation.

@type fragment() :: binary()

Query fragment.

@type fragments() :: [fragment() | param()]

Query fragments.

@type name() :: nil | atom()

Query name.

@type param() :: atom()

Query parameter.

@type queries() :: [query()]

Queries.

@type query() :: {name(), docs(), fragments()}

Query.

Functions

Link to this function

compile_queries(contents, options \\ [])

View Source
@spec compile_queries(binary(), AyeSQL.Lexer.options()) :: [Macro.t()] | no_return()

Compiles the contents of a file or string into valid AyeSQL queries.

Link to this function

compile_query(contents, options \\ [])

View Source
@spec compile_query(binary(), AyeSQL.Lexer.options()) :: Macro.t() | no_return()

Compiles a single query from the contents of a string.

Link to this function

eval_query(contents, options \\ [])

View Source
@spec eval_query(binary(), AyeSQL.Lexer.options()) ::
  (AyeSQL.Core.parameters(), AyeSQL.Core.options() ->
     {:ok, AyeSQL.Query.t() | term()} | {:error, AyeSQL.Error.t() | term()})
  | no_return()

Evaluates the contents of a string to an anonymous function with a query that receives parameters and options.