Skip to content

Instance Property

prefix

A prefix to be applied to coding keys before interpreting them as column names.
var prefix: String?

Discussion

The prefix, if set, is applied after the keyDecodingStrategy.

Example:

Prefix

Strategy

Coding key

Column name

nil

SQLRowDecoder.KeyDecodingStrategy.useDefaultKeys

FooBar

FooBar

p

SQLRowDecoder.KeyDecodingStrategy.useDefaultKeys

FooBar

pFooBar

nil

SQLRowDecoder.KeyDecodingStrategy.convertFromSnakeCase

FooBar

foo_bar

p

SQLRowDecoder.KeyDecodingStrategy.convertFromSnakeCase

FooBar

pfoo_bar