Skip to content

Instance Property

prefix

A prefix to be added to keys when encoding column names.
var prefix: String?

Discussion

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

Example:

Prefix

Strategy

Coding key

Column name

nil

SQLQueryEncoder.KeyEncodingStrategy.useDefaultKeys

FooBar

FooBar

p

SQLQueryEncoder.KeyEncodingStrategy.useDefaultKeys

FooBar

pFooBar

nil

SQLQueryEncoder.KeyEncodingStrategy.convertToSnakeCase

FooBar

foo_bar

p

SQLQueryEncoder.KeyEncodingStrategy.convertToSnakeCase

FooBar

pfoo_bar