What is XTS?
XTS stands for Extract Table Schema. In this approach GenRocket can retrieve one, many or all table schemas from a given database by connecting directly to the database via JDBC to extract the database’s schema. The extracted schema is saved to an encrypted file. The encrypted file can then be imported to the GenRocket web application to automatically do the following:
- Import the application / database Data Schema
- GenRocket XTS and Data Warehouse will automatically set up all of the Domains, Attributes and assign Generators
- You will use the Domain Referencing Wizard to establish Parent-Child-Sibling relationships for the Domains
- You will swap out the Generators that were incorrectly assigned by the Data Warehouse for the correct Generators and modify Generator parameters
The following command line options instruct's GenRocket to retrieve one, many or all table schemas from a given database by connecting directly to the database via JDBC to extract the database's schema. The extracted schema is saved to an encrypted file. The encrypted file can then be imported to the GenRocket web application to automatically create Domains for each table whose schema is defined within the encrypted file.
-xts, --export-table-schema <<pathToJDBCFile> <tableNames>>
- <pathToJDBCFile> - defines the path and file name of the JDBC Properties file
- Example: /home/jdoe/config/config.properties
- <tableName> - defines the names of one or more tables whose schema is to be extracted
- Example: genrocket -xts /home/jdoe/config/config.properties company,department,user
- If table belongs to a particular schema in your database, e.g. schema1 then your command should include schema name as well
- Example: genrocket -xts /home/jdoe/config/config.properties schema1:company,schema1:department, schema1:user
- If you want to export all tables of your schema, use <schemaName>:*
- Example: genrocket -xts /home/jdoe/config/config.properties schema1:*
- Importing tables from more than one schema
- Example: genrocket -xts /home/jdoe/config/config.properties schema1:user,schema2:address
- Note: By not providing any table names, all table's schema within the given database will be extracted
Connect to a Database
The GenRocket table schema importer must connect to a database via JDBC; it can do so by accessing a user's profile and locating a resource called, resource.jdbc.config. The resource.jdbc.config will contain the path to a JDBC configuration file located on the local computer.
JDBC Configuration File
The JDBC configuration file must contain the following four parameters (the order of the parameters does not matter):
- driver - the name of the database driver
- user - the username to connect to the database
- password - the password to connect to the database
- url - the universal resource locator to connect to the database
Example JDBC Configuration File
The following example configuration file connects to a MySQL database called, acme.
Sequence of Events
The following sequence diagram describes the steps that GenRocket executes once a -xts command is given:
Importing a .gxts File
Login to GenRocket web, create or go to a project a take the following two steps:
From the Domains window, New Domains pull down, select Import from XTS.
Select the .gts file to import and click the save button.