qsql (equery v0.22.0)
View SourceSQL statement compilation.
Turns a q:query/0 into a qast:ast_node/0 of a specific top-level
statement. Pair with qast:to_sql/1 to get {Sql, Args} ready for
parameterized execution.
Summary
Functions
-spec delete(q:query()) -> qast:ast_node().
Compile a query into a DELETE statement AST. Includes RETURNING.
-spec insert(q:query()) -> qast:ast_node().
Compile a query into an INSERT statement AST.
If set is a query(), emits INSERT INTO t (...) SELECT ....
If set is a map, emits INSERT INTO t (...) VALUES (...).
Always includes RETURNING (controlled via q:select/1,2).
-spec select(q:query()) -> qast:ast_node().
Compile a query into a SELECT statement AST.
-spec update(q:query()) -> qast:ast_node().
Compile a query into an UPDATE statement AST. Includes RETURNING.