Getting Started

In order to quickly make yourself familiar with TDK and its features without getting access to production-scale database servers, you can use the demo H2 database embedded into the CLI tool.

To start the demo source database server, run the following console command:

java -cp tdk.jar \
   -Dloader.main=io.synthesized.testingsuite.cli.DemoInputDB \
   org.springframework.boot.loader.PropertiesLauncher

This will start an embedded H2 server with demo data. The following output should appear in the console:

Started H2 server.

Connection url: jdbc:h2:tcp://localhost:9123/input
Username: sa
Password: <empty>
Sample CLI params: -iu "jdbc:h2:tcp://localhost:9123/input;DATABASE_TO_LOWER=TRUE" -iU sa

Now you can use any tool to connect to this database and browse its contents, for example, IntelliJ IDEA Database browser or the H2 Console Application:

inputdb

To start the demo output database server, run the following:

java -cp tdk.jar \
  -Dloader.main=io.synthesized.testingsuite.cli.DemoOutputDB \
  org.springframework.boot.loader.PropertiesLauncher

Now create a configuration file that defines the desired transformation. The complete reference for this file format is here, the simple configuration that tries to apply masking to all the data is

# config.yaml
default_config:
  mode: "MASKING"

Run the following command (you can run java -jar tdk.jar --help to get the full list of available command line options):

java -jar tdk.jar \
 -iu "jdbc:h2:tcp://localhost:9123/input;DATABASE_TO_LOWER=TRUE" -iU sa \
 -ou "jdbc:h2:tcp://localhost:9124/output;DATABASE_TO_LOWER=TRUE" -oU sa \
 -c config.yaml

Now browse the target database. You will see that the database structure has been copied, and the data is substituted by similar generated one:

outputdb

Congratulations, you’ve made your first data transformation using TDK! Now you can proceed with experiments with various config files and databases.