Skip to content

Structure

SQLGroupExpression

A fundamental syntactical expression - an arbitrary expression or list of expressions, surroudned by parenthesis.
struct SQLGroupExpression

Overview

This construct provides “grouping” syntax in numerous contexts. When a “group” contains more than one subexpression, all subexpressions are joined using SQLList with the default separator. See init(_:separator:) for aadditional information.

Example usage:

try await database.select()
    .column(...)
    .where("foo", .in, SQLGroupExpression(SQLBind(foo), SQLBind(bar)))
    ...
// Generated SQL: `SELECT ... FROM .. WHERE "foo" IN ($0, $1)`.

Topics

Initializers

  • init(_:)
    Create a group expression with a single subexpresion.

Instance Properties

  • expressions
    The potentially empty list of expressions to group.

Instance Methods

  • serialize(to:)
    Invoked when a request is made to serialize the expression to raw SQL.

Relationships

Conforms To

See Also

Syntactic Expressions

  • SQLBinaryExpression
    A fundamental syntactical expression - a left and right operand joined by an infix operator.
  • SQLBinaryOperator
    SQL binary expression operators.
  • SQLBind
    A parameterizied value bound to the SQL query.
  • SQLFunction
    A call to a function available in SQL, expressed as a name and a (possibly empty) list of arguments.
  • SQLIdentifier
    A fundamental syntactical expression - a quoted identifier (also often referred to as a “name” or “object name”).
  • SQLList
    A fundamental syntactical expression - a list of subexpresions with a specified “separator” subexpression.
  • SQLLiteral
    A fundamental syntactical expression - one of several various kinds of literal SQL expressions.
  • SQLRaw
    A fundamental syntactical expression - an arbitrary string of raw SQL with no escaping or formating of any kind.