Module quaint::ast

source ·
Expand description

An abstract syntax tree for SQL queries.

The ast module handles everything related building abstract SQL queries without going into database-level specifics. Everything related to the actual query building is in the visitor module.

For prelude, all important imports are in quaint::ast::*.

Structs

  • An aggregate function that concatenates strings from a group into a single string with various options.
  • A representation of the AVG function in the database.
  • Returns the first non-null expression
  • A column definition.
  • A builder for a common table expression (CTE) statement, to be used in the WITH block of a SELECT statement.
  • A representation of the Concat function in the database.
  • Returns the number of rows that matches a specified criteria.
  • A builder for a DELETE statement.
  • An expression that can be positioned in a query. Can be a single value or a statement that is evaluated into a value.
  • A database function definition
  • A list of definitions for the GROUP BY statement
  • A builder for an INSERT statement.
  • The JOIN table and conditions.
  • A represention of the LOWER function in the database.
  • A represention of the MAX function in the database.
  • A represention of the MIN function in the database.
  • A builder for an INSERT statement for multiple rows.
  • A list of definitions for the ORDER BY statement.
  • Determines the partitioning and ordering of a rowset before the associated window function is applied.
  • A value written to the query as-is without parameterization.
  • A collection of values surrounded by parentheses.
  • A window function that assigns a sequential integer number to each row in the query’s result set.
  • RowToJsonpostgresql
    A representation of the ROW_TO_JSON function in the database. Only for Postgresql
  • A builder for a SELECT statement.
  • A builder for an INSERT statement for a single row.
  • A represention of the SUM function in the database.
  • A table definition
  • Holds the expressions on which to perform a full-text search
  • Holds the expressions & query on which to perform a text-search ranking compute
  • A builder for a UNIONs over multiple SELECT statements.
  • A builder for an UPDATE statement.
  • A represention of the UPPER function in the database.
  • An in-memory temporary table. Can be used in some of the databases in a place of an actual table. Doesn’t work in MySQL 5.7.

Enums

Traits

Functions

  • Aggregates the given field into a string.
  • A quick alias to create an asterisk to a table.
  • Calculates the average value of a numeric column.
  • Returns the first non-null argument
  • Concat several expressions.
  • Count of the underlying table where the given expression is not null.
  • A quick alias to create a default value expression.
  • Extracts a subset of a JSON blob given a path. Two types of paths can be used:
  • Converts a JSON expression into string and unquotes it.
  • Converts the result of the expression into lowercase string.
  • Calculates the maximum value of a numeric column.
  • Calculates the minimum value of a numeric column.
  • Generates the function uuid_to_bin(uuid()) returning a binary uuid in MySQL
  • A number from 1 to n in specified order
  • row_to_jsonpostgresql
    Return the given table in JSON format.
  • Calculates the sum value of a numeric column.
  • Performs a full-text search. Use it in combination with the .matches() comparable.
  • Computes the relevance score of a full-text search query against some expressions.
  • Converts the result of the expression into uppercase string.
  • Generates the function uuid_to_bin(uuid()) returning a binary uuid in MySQL
  • Generates an optimized swapped UUID in MySQL 8 see <https://dev.mysql.com/doc/refman/8.0/en/miscellaneous-functions.html#function_uuid-to-bin>

Type Definitions