Subsetting options file
Published 16 October 2023
The following can be used to control how a subset is made from a source database. All of these are optional.
Name | Description | Notes | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
jsonSchemaVersion | The version of schema of the the options file. | Defaults to 1. | ||||||||||
desiredSize | The approximate size to make the target database, in the form x(B|KB|MB|GB|TB) (e.g. 5GB). | This cannot be used in conjunction with This is an approximate size and the actual size of the target database may be different, especially for small databases. | ||||||||||
startingTables | The tables at which to start from when creating a subset. These are defined with:
| This cannot be used in conjunction with When there are multiple starting tables, the subsetter brings in all data that matches any of the filter clauses and all data that links to it. | ||||||||||
staticDataTables | Any tables to be treated as static data tables. | Tables defined as static data tables will be included, but the subsetter will follow only outward relationships. Any rows referenced by a foreign key on this table will be included. | ||||||||||
excludedTables | Any tables to ignore when subsetting. | Tables that have foreign keys referencing an excluded table will also be excluded. | ||||||||||
manualRelationships | Any relationships between tables that are not already defined in the database as foreign keys. These are defined with:
| Manual relationships are treated the same foreign keys defined in the database. The referential integrity of these relationships will be maintained when subsetting. | ||||||||||
includeTablesRowThreshold | The maximum number of rows a table with no foreign keys can have to be included automatically as a static data table. | The default value if not specified is 300. | ||||||||||
useTemporaryTables | Use temporary tables as a working space rather than tables in the source database. | This applies to SQL Server only. |
Example JSON options file
{ "jsonSchemaVersion": 1, "startingTables": [ { "table": { "schema": "dbo", "name": "Users" }, "filterClause": "OrgId = 1" } ], "staticDataTables": [ { "schema": "dbo", "name": "Countries" } ], "excludedTables": [ { "schema": "dbo", "name": "Comments" } ], "manualRelationships": [ { "sourceTable": { "schema": "dbo", "name": "SourceTest" }, "sourceColumns": [ "TargetId" ], "targetTable": { "schema": "dbo", "name": "TargetTest" }, "targetColumns": [ "Id" ] } ], "includeTablesRowThreshold": 300 }
Subsetting options file formats
Both JSON and YAML file formats are supported as an ways to configure subsetting behavior.