Instance Method
normalizeSQLConstraint(identifier:)
A function which is consulted whenever a constraint name will be serialized into a query. The dialect must return an expression for an identifer which is unique to the input identifier and is a valid constraint name for the dialect.
func normalizeSQLConstraint(identifier: any SQLExpression) -> any SQLExpression
Discussion
This provides an interception point for dialects which impose limitations on constraint names, such as length limits or a database-wide uniqueness requirement. It is not required that it be possible to convert a normalized identifer back to its original form (the conversion may be lossy). This function must not return the same result for different inputs, and must always return the same result when given the same input. A hashing function with a sufficiently large output size, such as SHA-256, is one possible correct implementation.
Defaults to returning the input identifier unchanged.
Default Implementations
SQLDialect Implementations
normalizeSQLConstraint(identifier:)Default implementation ofnormalizeSQLConstraint(identifier:).
See Also
Modifier Methods
customDataType(for:)A function which is consulted whenever anSQLDataTypewill be serialized into a query. The dialect may return an expression which will replace the default serialization of the given type. Returningnilcauses the default to be used.nestedSubpathExpression(in:for:)Given a column name and a path consisting of one or more elements, return an expression appropriate for accessing a value at the given JSON path.