Skip to content

Intro

Transformers are the building blocks of Skifta, they are the ones controlling how the data should be changed. They are specified at column level for each of the tables. In each transformers documentation there are more information on what it’s supposed to do and also how it’s altering the value, it can either generate a new one or mutate an existing.

Transformers

Configuration

The transformers can either be configured with specifying shorthand values utilising each respective transformers default configurations or they can be specified as Objects with more granular configuration for each transformer. For more information about what the different transformers has for specific options visit their respective documentation.


Shorthand

The transformers can either be specified with shorthand values which will use the default transform values. What each respective has as default transform value you can find out in respective transformers documentation. An exammple using the shorthand for the name transformer is as:

skifta.toml
[[table]]
name = "table-name"
columns = [
{ name = "column-name", transformer = "name" },
]

Objects

Some transformer also have more granular then just the default values, for example the name transformer transformer can specify wether or not first and/or lastname should exist, such as

skifta.toml
[[table]]
name = "table-name"
columns = [
{ name = "column-name", transformer = { name = { first-name = true } } },
]

Structure

Since the configuration of Skifta is using Toml format the configuration can be specified differently. It’s possible to either just specify the configuration in Array of Tables or just simply Table. Given that information here are 2 examples which will work the same but they’re structured differently.

skifta.toml
[[table]]
name = "table-name"
columns = [
{ name = "column-name", transformer = "name" },
]
skifta.toml
[[table]]
name = "table-name"
[[table.columns]]
name = "column-example"
transformer = "name"