Skip to content

Instance Method

customDataType(for:)

A function which is consulted whenever an SQLDataType will be serialized into a query. The dialect may return an expression which will replace the default serialization of the given type. Returning nil causes the default to be used.
func customDataType(for dataType: SQLDataType) -> (any SQLExpression)?

Discussion

This is intended to provide a customization point for dialects to override or supplement the default set of types and their default definitions.

Defaults to returning nil for all inputs.

Default Implementations

SQLDialect Implementations

See Also

Modifier Methods

  • 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.
  • 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.