Skip to content
Permalink
Browse files

0003863: DbFill cascade and select handle composite and self-referencing

foreign key
  • Loading branch information...
erilong committed Jan 25, 2019
1 parent a30c716 commit ae60f826dddab93bbbe8c878521e4374f83b9c2b
@@ -43,7 +43,8 @@ They are as follows:
- *--repeat <arg>* : Number of times to repeat the count of rows.
- *--rollback <arg>* : Percent chance (0-100) to perform a rollback.
- *--schema <arg>* : Look for tables in schema.
- *--select* : Select foreign key dependent data to satisfy constrains.
- *--select* : Select foreign key dependent data to satisfy constraints.
- *--truncate* : Truncate the tables before filling them.
- *-v, --verbose* : Use verbose format for console output.
- *--weights <arg>* : By default, an insert is performed for each count ('1, 0, 0'). To randomly select between an insert, update or delete on each table, weight can be applied so inserts an occur more than deletes. To make sure inserts happen twice as much as updates, and deletes are never performed use '2,1,0'.

@@ -66,6 +66,8 @@
private static final String OPTION_COMMIT_DELAY = "commit-delay";

private static final String OPTION_ROLLBACK = "rollback";

private static final String OPTION_TRUNCATE = "truncate";

public DbFillCommand() {
super("dbfill", "[tablename...]", "DbFill.Option.");
@@ -111,6 +113,7 @@ protected void buildOptions(Options options) {
addOption(options, null, OPTION_COMMIT, true);
addOption(options, null, OPTION_COMMIT_DELAY, true);
addOption(options, null, OPTION_ROLLBACK, true);
addOption(options, null, OPTION_TRUNCATE, false);
}

@Override
@@ -181,6 +184,10 @@ protected boolean executeWithOptions(CommandLine line) throws Exception {
if (line.hasOption(OPTION_ROLLBACK)) {
dbFill.setPercentRollback(Integer.parseInt(line.getOptionValue(OPTION_ROLLBACK)));
}
if (line.hasOption(OPTION_TRUNCATE)) {
dbFill.setTruncate(true);
}

// Ignore the Symmetric config tables.
getSymmetricEngine();
IParameterService parameterService = engine.getParameterService();
@@ -172,6 +172,7 @@ DbFill.Option.rand=Randomize number of rows to generate and commit.
DbFill.Option.repeat=Number of times to repeat the count of rows.
DbFill.Option.rollback=Percent chance (0-100) to perform a rollback.
DbFill.Option.select=Select foreign key dependent data to satisfy constraints.
DbFill.Option.truncate=Truncate the tables before filling them.

DbCompare.Option.exclude=A comma-separated list of table names to exclude from comparison.
DbCompare.Option.output=A file name to output delta SQL (insert/update/delete statements) that would bring the target into sync with the source. You can use the %t pattern to use the table name as part of the file and generate a file per table. (E.g. /output/%t.diff.sql)
Oops, something went wrong.

0 comments on commit ae60f82

Please sign in to comment.
You can’t perform that action at this time.