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
SQLDataType.bigintTranslates toBIGINT, unless overridden by dialect. Almost always an integer with 64-bit range.SQLDataType.blobTranslates toBLOB, unless overridden by dialect. Represents binary non-textual data (i.e. an arbitrary byte string admitting of no particular format or representation).SQLDataType.custom(_:)Translates to the serialization of the given expression, unless overridden by dialect.SQLDataType.intTranslates toINTEGER, unless overridden by dialect. Usually an integer with at least 32-bit range.SQLDataType.realTranslates toREAL, unless overridden by dialect. Usually a decimal value with at least 32-bit precision.SQLDataType.smallintTranslates toSMALLINT, unless overriden by dialect. Usually an integer with at least 16-bit range.SQLDataType.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
serialize(to:)Invoked when a request is made to serialize the expression to raw SQL.
Type Properties
timestampTranslates 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
Relationships
Conforms To
SQLExpressionSwift.SendableSwift.SendableMetatype
See Also
Basic Expressions
SQLAliasEncapsulates SQL’s<expression> [AS] <name>syntax, most often used to declare aliaed names for columns and tables.SQLBetweenAnSQLExpressionwhich constructs SQL of the form<operand> BETWEEN <lowerBound> AND <upperBound>.SQLColumnAn expression representing an optionally table-qualified column in an SQL table.SQLConstraintAn expression representing the combination of a constraint name and algorithm for table constraints.SQLDirectionDescribes an ordering direction for a given sorting key.SQLDistinctAn expression representing the subexpression of an aggregate function call which specifies whether the aggregate groups over all result rows or only distinct rows.SQLForeignKeyActionAn expression specifying a behavior for a foreign key constraint violation.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.SQLQualifiedTableAn expression representing an optionally second-level-qualified SQL table.SQLQueryStringAn expression consisting of an array of constituent subexpressions generated by custom string interpolations.