Skip to content

Case

SQLQueryEncoder.KeyEncodingStrategy.custom(_:)

Provide a custom conversion to the key in the encoded row from the keys specified by the encoded types.
@preconcurrency case custom(@Sendable ([any CodingKey]) -> any CodingKey)

Discussion

The full path to the current encoding position is provided for context (in case you need to locate this key within the payload). The returned key is used in place of the last component in the coding path before encoding.

If the result of the conversion is a duplicate key, then only one value will be present in the result.