Enumeration
SQLDataType
Represents a value’s type in SQL.
enum SQLDataType
Overview
In practice it is not generally possible to list all of the data types supported by any given database, nor to define a useful set of types with identical behaviors which are available across all databases, despite the attempted influence of ANSI SQL. As such, this type primarily functions as a front end for customDataType(for:).
Topics
Enumeration Cases
case bigintTranslates toBIGINT, unless overridden by dialect. Almost always an integer with 64-bit range.case blobTranslates toBLOB, unless overridden by dialect. Represents binary non-textual data (i.e. an arbitrary byte string admitting of no particular format or representation).case custom(any SQLExpression)Translates to the serialization of the given expression, unless overridden by dialect.case intTranslates toINTEGER, unless overridden by dialect. Usually an integer with at least 32-bit range.case realTranslates toREAL, unless overridden by dialect. Usually a decimal value with at least 32-bit precision.case smallintTranslates toSMALLINT, unless overriden by dialect. Usually an integer with at least 16-bit range.case textTranslates toTEXT, unless overridden by dialect. Represents non-binary textual data (i.e. human-readable text potentially having an explicit character set and collation).
Instance Methods
func serialize(to: inout SQLSerializer)Invoked when a request is made to serialize the expression to raw SQL.
Type Properties
static var timestamp: SQLDataTypeTranslates toTIMESTAMP, unless overridden by dialect. Represents a type suitable for storing the encoded value of aDatein a form which can be saved to and reloaded from the database without suffering skew caused by time zone calculations.
Type Methods
static `enum`(_:)Translates to an enumeration including the specified list of cases.static func type(String) -> SQLDataTypeAn inadvertently public test utility. Do not use.
Relationships
Conforms To
SQLExpressionSwift.SendableSwift.SendableMetatype
See Also
Basic Expressions
struct SQLAliasEncapsulates SQL’s<expression> [AS] <name>syntax, most often used to declare aliaed names for columns and tables.struct SQLBetweenAnSQLExpressionwhich constructs SQL of the form<operand> BETWEEN <lowerBound> AND <upperBound>.struct SQLColumnAn expression representing an optionally table-qualified column in an SQL table.struct SQLConstraintAn expression representing the combination of a constraint name and algorithm for table constraints.enum SQLDirectionDescribes an ordering direction for a given sorting key.struct SQLDistinctAn expression representing the subexpression of an aggregate function call which specifies whether the aggregate groups over all result rows or only distinct rows.enum SQLForeignKeyActionAn expression specifying a behavior for a foreign key constraint violation.struct SQLNestedSubpathExpressionA “nested subpath” expression is used to descend into the “deeper” structure of a non-scalar value, such as a dictionary, array, or JSON value.struct SQLQualifiedTableAn expression representing an optionally second-level-qualified SQL table.struct SQLQueryStringAn expression consisting of an array of constituent subexpressions generated by custom string interpolations.