Skip to content

Configuration

How to configure

Skifta uses TOML for it’s configuration.

API Key

If you’ve not acquired an API key yet please see the Authentication section.

Dialect

Currently only a few supported dialects are supported, you can read more about this in the Dialect section.

Transformers

Transformers is the building blocks on how the data will be transformed, see the Transformers intro for more information about them.

Table

In order for Skifta to be able to know what table it should transform the configuration needs to have a pointer to the table name.

skifta.toml
[[table]]
name = "this-is-the-table-name"

Once a table is specified what’s left is specifying what column or columns should be transformed.

Column

When a table is defined what’s left is pointing out what columns should be transformed and with what transformer. The available transformers can be seen under Transformers.

skifta.toml
[[table.columns]]
name = "phone"
transformer = "phone-number"

When there are multiple columns which needs to be transformer for a single table another syntax can be used for clearer overview.

skifta.toml
[[table]]
name = "employees"
columns = [
{ name = "last_name", transformer = "last-name" },
{ name = "first_name", transformer = "first-name" },
{ name = "home_phone", transformer = "phone-number" },
]

Example

Example on how a configuration file might look like

skifta.toml
dialect = "postgres"
[[table]]
name = "customers"
[[table.columns]]
name = "contact_name"
transformer = "name"
[[table]]
name = "employees"
columns = [
{ name = "last_name", transformer = "last-name" },
{ name = "first_name", transformer = "first-name" },
{ name = "home_phone", transformer = "phone-number" },
]
[[table]]
name = "suppliers"
columns = [
{ name = "contact_name", transformer = "name" },
{ name = "phone", transformer = "phone-number" },
{ name = "fax", transformer = "phone-number" },
]