Structure
SQLRaw
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
init(_:)Create a new raw SQL text expression.init(_:_:)
Instance Properties
bindsLegacy property specifying bound values. This property’s value is IGNORED.sqlThe 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
SQLExpressionSwift.SendableSwift.SendableMetatype
See Also
Syntactic Expressions
SQLBinaryExpressionA fundamental syntactical expression - a left and right operand joined by an infix operator.SQLBinaryOperatorSQL binary expression operators.SQLBindA parameterizied value bound to the SQL query.SQLFunctionA call to a function available in SQL, expressed as a name and a (possibly empty) list of arguments.SQLGroupExpressionA fundamental syntactical expression - an arbitrary expression or list of expressions, surroudned by parenthesis.SQLIdentifierA fundamental syntactical expression - a quoted identifier (also often referred to as a “name” or “object name”).SQLListA fundamental syntactical expression - a list of subexpresions with a specified “separator” subexpression.SQLLiteralA fundamental syntactical expression - one of several various kinds of literal SQL expressions.