View Source PgQuery (PgQuery v0.6.0)

Summary

Functions

Parses the binary statement stmt into a Protobuf AST.

Parses the binary statement stmt into a Protobuf AST.

Deparses the Protobuf AST parse_result into a query string.

Deparses the Protobuf AST parse_result into a query string.

Types

@type error() :: %{message: String.t(), cursorpos: non_neg_integer()}

Functions

@spec parse(String.t()) ::
  {:ok, %PgQuery.ParseResult{stmts: term(), version: term()}}
  | {:error, error()}

Parses the binary statement stmt into a Protobuf AST.

@spec parse!(String.t()) ::
  %PgQuery.ParseResult{stmts: term(), version: term()} | no_return()

Parses the binary statement stmt into a Protobuf AST.

Raises if the statement is invalid.

Link to this function

protobuf_to_query(parse_result)

View Source
@spec protobuf_to_query(%PgQuery.ParseResult{stmts: term(), version: term()}) ::
  {:ok, String.t()} | {:error, error()}

Deparses the Protobuf AST parse_result into a query string.

Link to this function

protobuf_to_query!(parse_result)

View Source
@spec protobuf_to_query!(%PgQuery.ParseResult{stmts: term(), version: term()}) ::
  String.t() | no_return()

Deparses the Protobuf AST parse_result into a query string.