Skip to content

Structure

SQLRaw

A fundamental syntactical expression - an arbitrary string of raw SQL with no escaping or formating of any kind.
struct SQLRaw

Overview

Users should almost never need to use SQLRaw directly; there is almost always a better/safer/more specific expression available for any given purpose. The most common use for SQLRaw by end users is to represent SQL keywords specific to a dialect, such as SQLRaw("EXPLAIN VERBOSE").

In effect, SQLRaw is nothing but a wrapper which makes Strings into SQLExpressions, since conforming String directly to the protocol would cause numerous issues with SQLKit’s existing public API (yet another design flaw). In the past, SQLRaw was intended to also contain bound values to be serialized with the text, but this functionality was never implemented fully and is now entirely defunct.

Note

Just to add further insult to injury, SQLRaw is entirely redundant in the presence of SQLQueryString and SQLStatement, but is used so pervasively that it cannot reasonably be deprecated.

Topics

Initializers

Instance Properties

  • binds
    Legacy property specifying bound values. This property’s value is IGNORED.
  • sql
    The raw SQL text serialized by this expression.

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.
  • SQLGroupExpression
    A fundamental syntactical expression - an arbitrary expression or list of expressions, surroudned by parenthesis.
  • 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.