This documentation is available to agents as Markdown at https://docs.synthesized.io/tdk/latest/user_guide/040_reference/configuration/configuration_reference.md. For the complete documentation index, see llms.txt.

YAML configuration

YAML configuration

To execute a transformation user provides a YAML configuration file with properties of a specific transformation. UserConfig is the root object of this configuration file. This object consists of default table configuration and a list of user-defined table config overrides and a set of global settings. Example:

default_config:
  mode: KEEP
  target_ratio: 1.0

tables:
  - table_name_with_schema: "public.orders"
    mode: MASKING
    target_ratio: 0.1
    cycle_breaker_references: [ "public.orders" ]
    insert_batch_size: 1000
    use_working_directory: true
    transformations:
      - columns: [ "status" ]
        params:
          type: "categorical_generator"
          categories:
            value_source: PROVIDED
            values:
              "Shipped": 8
              "Cancelled": 2

cycle_resolution_strategy: FAIL
schema_creation_mode: CREATE_IF_NOT_EXISTS
table_truncation_mode: TRUNCATE
global_seed: 42
safety_mode: "RELAXED"

Properties

  • matchers: [#UserConfig_tables]

  • tables: [#UserConfig_cycle_resolution_strategy]

  • cycle_resolution_strategy: Cycle resolution strategy.

  • global_seed: A value used a seed for random number generators. Should be string in base64 encoded format. Basic alphabet (please refer to https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Base64.html) The result of generation must be the same each time the generation is being run with the same seed and workflow configuration. By default, this is set to an empty string, which corresponds to an empty byte array.

  • schemas: List of schemas to process. If not set or null, all available schemas will be processed.

  • use_text_column_heuristics: Enables column and table name heuristics for selecting transformations for text fields. If enabled, the address_generator, person_generator and finance_generator can be chosen for text fields in GENERATION mode.

Default configuration

Used in: default_config

Consists of the default table configuration parameters that are applied to all tables by default and a list of rules that are conditionally applied to the table.

Properties

  • target_ratio: The relative size of each table of the output database with respect to the input. The number of rows of each output table will be computed by multiplying this parameter by the input table size. If not provided, this parameter will be target_ratio = 1, resulting on same size for input and output databases. Can be overridden by target_row_number

  • target_row_number: The absolute size of each table of the output database in rows. This parameter is applicable only for GENERATION mode. If not provided, target_ratio will be used.

  • insert_batch_size: Indicates how many table rows are inserted to the database per each batch operation. The default value for this parameter is set at 1000 rows.

  • use_working_directory: Whether to use the configured local working directory to perform certain I/O operations more efficiently. In some cases, using working directory can speed up table insertion speed by several times. However, the more tables use the working directory, the more space is needed for it. Note that this setting is only effective when the working directory is configured globally (see Working directory properties).

  • locale: Default locale for specific transformations, such as person_generator and address_generator. This value can be overridden at the column transformation level.

Supported locales:

ar

bg

ca

ca-CAT

cs

da-DK

de

de-AT

de-CH

en

en-AU

en-CA

en-GB

en-IN

en-MS

en-NEP

en-NG

en-NZ

en-PAK

en-SG

en-UG

en-US

en-ZA

en-PH

es

es-MX

fa

fi-FI

fr

he

hu

in-ID

it

ja

ko

nb-NO

nl

pl

pt

pt-BR

ru

sk

sv

sv-SE

th

tr

uk

vi

zh-CN

zh-TW

  • in_memory_filter_threshold: Advanced performance tuning parameter. This parameter determines whether values the parent table are loaded into memory during filtering operations, depending on the table size. If the size of the table does not exceed this specified value, the values will be loaded into memory for filtering for child tables. The higher this threshold, the faster the filter can potentially run, provided that all values fit in memory. But if there is not enough memory, it may cause an error. The default value for this parameter is set at 100_000 rows.

  • items: The rules used to select the appropriate transformation depending on the database metadata if one is not specified in the user’s configuration.

  • additional_items: Additional rules used to select the appropriate transformation depending on the database metadata if one is not specified in the user’s configuration. These rules take precedence over the rules in items: when a field matches both an additional_items rule and an items rule, the additional_items rule wins. Rules are evaluated in order and the first matching rule per field is applied. Use this to layer environment-specific overrides on top of the shared items rules without editing them. For example, an items rules by default in MASKING mode mask every column, while an additional_items rule tells the engine to put nulls in all nullable columns. The result of the execution is that all nullable columns will be nullified, while the rest of the columns will be masked. Example:

default_config:
  mode: MASKING
  additional_items:
      - id: Nullify nullable
        conditions:
          - type: is_nullable
        transformation:
          type: null_generator

Cycle resolution strategy

Defines how to deal with cycles in table relations via foreign keys.

FAIL

if this mode is selected, cycle_breaker_references should be provided in the configuration file. Otherwise, execution will fail if a circular reference is detected in the schema.

DELETE_NOT_REQUIRED

if this mode is selected, cyclic references will be resolved automatically by removing the last nullable reference that leads to the cycle. As a result, the cyclic reference columns will be masked to nulls.

DEFER_FOREIGN_KEY

Oracle, MSSQL, MySQL and DB2 only. If this mode is selected, cyclic references will be automatically resolved by disabling foreign keys that lead to cycles during insertion. These references are re-enabled after the data has been inserted. As a result, the columns with cyclic references will be processed like any other keys in the schema. This strategy is only available when using MASKING or KEEP mode, and only with a target_ratio of 1.

Example for a cycle breaker reference:

schema_creation_mode: CREATE_IF_NOT_EXISTS
cycle_resolution_strategy: FAIL
table_truncation_mode: TRUNCATE
safety_mode: "RELAXED"
default_config:
  mode: GENERATION
  target_ratio: 1.0
tables:
  - table_name_with_schema: "public.employees"
    cycle_breaker_references: ["public.employees"]

Where the employees table contains a cycle reference.

Enum values
  • FAIL

  • DELETE_NOT_REQUIRED

  • DEFER_FOREIGN_KEY

Schema Creation Mode

Defines the mode of schema creation.

The schema creation feature only restores parts of the original schema required for Synthesized execution, such as tables, constraints, and indexes. Other database objects such as triggers, views, procedures, functions, and any vendor-specific properties are not supported.
CREATE_IF_NOT_EXISTS

if this mode is selected, DDL schema will be copied from the source database to the target one if it does not exist, existing schema will be used otherwise.

DO_NOT_CREATE

if this mode is selected, the existing schema will be used without any validations. Please use this mode carefully: run-time errors may occur if the input and output schema do not match.

CREATE

if this mode is selected, DDL schema will be copied from the source database to the target one. The target database should be empty.

DROP_AND_CREATE

if this mode is selected, DDL schema will be copied from the source database to the target one. Existing schema in the target database will be dropped. Please use this mode carefully.

Enum values
  • DO_NOT_CREATE

  • CREATE

  • CREATE_IF_NOT_EXISTS

  • DROP_AND_CREATE

Table truncation mode

Defines the mode of table truncation.

DO_NOT_TRUNCATE

(default) if this mode is selected, tables in the target database won’t be truncated. An empty target database required.

TRUNCATE

if this mode is selected, tables in the target database will be truncated.

IGNORE

if this mode is selected, the status of the target database is ignored.

Enum values
  • DO_NOT_TRUNCATE

  • TRUNCATE

  • IGNORE

Safety Mode

Used in: safety_mode

The mode of choosing transformations.

STRICT

if this mode is selected and no matching transformation found, then no passthrough, categorical_generator, null_generator, constant_generator transformations will be chosen by default. If no matching transformation found, an error occurs. If DEFER_FOREIGN_KEY cycle resolution strategy fails to re-enable a foreign key after transformation, an error occurs.

RELAXED

if this mode is selected and no matching transformation found, then the passthrough transformation will be applied for MASKING mode, and null_generator or categorical_generator for GENERATION mode. Constant generators constant_numeric, constant_string, constant_date, constant_boolean will be chosen by default where the source column contains the same value in all rows. If DEFER_FOREIGN_KEY cycle resolution strategy fails to re-enable a foreign key after transformation, a warning is shown in logs and transformation continues.

This property has no meaning for KEEP mode. Default: STRICT.

Enum values
  • STRICT

  • RELAXED

Additional Metadata

Used in: metadata

Metadata that is not defined at the database level but must be taken into account when performing transformations.

Properties

  • tables: [#AdditionalMetadata_schemas]

  • schemas: Schema mappings for transformations. Each mapping specifies an input schema to read from and an output schema to write to. Used for single-database transformations or cross-database schema renaming.

Pre and post execution scripts

Used in: scripts

SQL scripts to be executed on the target database before or after the transformation process.

Example:

scripts:
  pre:
    source: INLINE
    script: |
      ALTER TABLE public.transaction DISABLE TRIGGER ALL;
  post:
    source: FILE
    path: post_script.sql

The post script will be executed after the transformation process in any case, including errors during the execution of the pre-script or the transformation process.

Properties

Config Variables

Used in: variables

A top-level block for YAML anchors (&name value), aliased elsewhere in the config as *name. Not read directly; declaring it here only keeps the block valid against the schema and safe to parse.

Transformation mode

Used in: mode

Defines table processing mode.

KEEP

if this mode is selected, the original data will be copied as it is. When this mode is selected, the output size needs to be smaller than the input, i.e. target_ratio <= 1.

MASKING

if this mode is selected, masking transformations will be applied to the original data. When this mode is selected, the output size needs to be smaller than the input, i.e. target_ratio <= 1.

GENERATION

if this mode is selected, the synthesized engine will learn the original data and generate new synthetic data. For this mode, the output database can be bigger than the input, so target_ratio can be greater than 1.

Both KEEP and MASKING modes apply a transformation to original data. While KEEP uses passthrough as default transformation, while MASKING automatically assigns a privacy preserving masking transformation to all columns. See transformations list for more details. For all modes, the user can override default transformers.
Enum values
  • MASKING

  • GENERATION

  • KEEP

Parent data mode

Used in: parent_data_mode

What part of parent data to consider for the child table processing. Default is ALL. If defined on the table level, the parent data mode is applied to all suitable transformations of the table.

Enum values
  • NEW

  • OLD

  • ALL

Checkpoint

Used in: checkpoint

Represents an entry point for handling repeated transformations.

Depending on mode property value, can be one of the following:

refresh

ignore_table

incremental

Fetch configuration

Used in: fetch

Configuration for how data is read from the source database per table. When not specified, defaults to streaming with a fetch size of 1000.

Depending on type property value, can be one of the following:

streaming

chunking

Pre and post execution script

Used in: pre, post

Depending on source property value, can be one of the following:

INLINE

FILE

Refresh Checkpoint

Represents a checkpoint for refreshing transformations. It is equivalent to full re-execution of the table transformation. CAUTION: This checkpoint will always start from the beginning of the table, ignoring any previously processed data. This may lead to data duplication or constraints violation in the target database if the transformation has already been partially executed.

Properties

  • mode = refresh

Ignore Table Checkpoint

Represents a checkpoint for ignoring table on hitting checkpoint in any other table. NOTE: This checkpoint will skip the table transformation, which may lead to missing the data in the target database for this table. If you want to ensure that the table in the output database is up to date, use the refresh or incremental checkpoint instead.

Properties

  • mode = ignore_table

Incremental Checkpoint

Properties

  • mode = incremental

Streaming fetch configuration

Uses JDBC server-side cursors (fetchLazy()). This is the default and provides the lowest memory overhead, but does not survive connection drops — if the connection is lost mid-read, the entire read fails and must restart from the beginning.

Properties

  • type = streaming

Chunking fetch configuration

Uses keyset pagination (on primary key or unique key) to read data in independent stateless chunks. Each chunk is a separate query bounded by a checkpoint, so the read can resume from the last checkpoint after a connection drop. Not all dialects support chunking; specifying chunking for an unsupported dialect is a configuration error.

Properties

  • type = chunking

Inline pre and post execution script

The inline SQL script that will be executed before or after the transformation process.

Properties

  • source = INLINE

File pre and post execution script

The file with SQL script that will be executed before or after the transformation process.

Properties

  • source = FILE