protected static String getSchemaObjectWithPrefixPattern(String startQuoteStr, String endQuoteStr, String objectNamePrefix) { return "(?:" + namePattern(startQuoteStr, endQuoteStr) + "\\.)?" + nameWithPrefixPattern(startQuoteStr, endQuoteStr, objectNamePrefix); }
@Override public void value(String[] argSubset) { AquaRevengArgs newArgsObj = new ArgsParser().parse(argSubset, new AquaRevengArgs()); AbstractDdlReveng ddlReveng = newArgsObj.getDbPlatform().getDdlReveng(); ddlReveng.reveng(newArgsObj); } });
public void reveng(AquaRevengArgs args) { if (args.getInputPath() == null) { File file = printInstructions(System.out, args); System.out.println(""); System.out.println(""); if (file != null) { System.out.println("Interim reverse-engineering from the vendor tool is complete."); System.out.println("Content was written to: " + file); System.out.println("Proceeding with full reverse-engineering: " + file); System.out.println(""); System.out.println("*** In case the interim content had issues when reverse-engineering to the final output, you can update the interim files and restart from there (without going back to the DB) by specifying the following argument:"); System.out.println(" -inputPath " + ObjectUtils.defaultIfNull(args.getOutputPath(), "<outputFile>")); revengMain(file, args); } else { System.out.println("***********"); System.out.println(""); System.out.println("Once those steps are done, rerun the reverse-engineering command you just ran, but add the following argument based on the <outputDirectory> value passed in above the argument:"); System.out.println(" -inputPath " + ObjectUtils.defaultIfNull(args.getOutputPath(), "<outputFile>")); System.out.println(""); System.out.println("If you need more information on the vendor reverse engineer process, see the doc: https://goldmansachs.github.io/obevo/reverse-engineer-dbmstools.html"); } } else { revengMain(args.getInputPath(), args); } }
static String getCatalogSchemaObjectPattern(String startQuoteStr, String endQuoteStr) { return "(?:" + namePattern(startQuoteStr, endQuoteStr) + "\\.)?" + "(?:" + namePattern(startQuoteStr, endQuoteStr) + "\\.)?" + namePattern(startQuoteStr, endQuoteStr); }
@Override public Iterable<ChangeEntry> valueOf(FileProcessingContext fileProcessingContext) { String schema = getObjectSchema(args.getDbSchema(), fileProcessingContext.getFile().getName()); return revengFile(schemaObjectReplacer, fileProcessingContext.getSnippetPatternMatchPairs(), schema); } });
@Test @Override public void testReverseEngineeringFromFile() throws Exception { File outputDir = new File("./target/db2revengoutput"); FileUtils.deleteDirectory(outputDir); AquaRevengArgs args = new AquaRevengArgs(); args.setDbSchema(SCHEMA); args.setInputPath(new File("./src/test/resources/reveng/db2look/input/db2input.txt")); args.setGenerateBaseline(false); args.setOutputPath(outputDir); new Db2DbPlatform().getDdlReveng().reveng(args); DirectoryAssert.assertDirectoriesEqual(new File("./src/test/resources/reveng/db2look/expected"), new File(outputDir, "final")); }
public void reveng(AquaRevengArgs args) { if (args.getInputPath() == null) { File file = printInstructions(System.out, args); System.out.println(""); System.out.println(""); if (file != null) { System.out.println("Interim reverse-engineering from the vendor tool is complete."); System.out.println("Content was written to: " + file); System.out.println("Proceeding with full reverse-engineering: " + file); System.out.println(""); System.out.println("*** In case the interim content had issues when reverse-engineering to the final output, you can update the interim files and restart from there (without going back to the DB) by specifying the following argument:"); System.out.println(" -inputPath " + ObjectUtils.defaultIfNull(args.getOutputPath(), "<outputFile>")); revengMain(file, args); } else { System.out.println("***********"); System.out.println(""); System.out.println("Once those steps are done, rerun the reverse-engineering command you just ran, but add the following argument based on the <outputDirectory> value passed in above the argument:"); System.out.println(" -inputPath " + ObjectUtils.defaultIfNull(args.getOutputPath(), "<outputFile>")); System.out.println(""); System.out.println("If you need more information on the vendor reverse engineer process, see the doc: https://goldmansachs.github.io/obevo/reverse-engineer-dbmstools.html"); } } else { revengMain(args.getInputPath(), args); } }
static String getCatalogSchemaObjectPattern(String startQuoteStr, String endQuoteStr) { return "(?:" + namePattern(startQuoteStr, endQuoteStr) + "\\.)?" + "(?:" + namePattern(startQuoteStr, endQuoteStr) + "\\.)?" + namePattern(startQuoteStr, endQuoteStr); }
@Override public Iterable<ChangeEntry> valueOf(FileProcessingContext fileProcessingContext) { String schema = getObjectSchema(args.getDbSchema(), fileProcessingContext.getFile().getName()); return revengFile(schemaObjectReplacer, fileProcessingContext.getSnippetPatternMatchPairs(), schema); } });
@Test @Override public void testReverseEngineeringFromFile() throws Exception { File outputDir = new File("./target/db2revengoutput"); FileUtils.deleteDirectory(outputDir); AquaRevengArgs args = new AquaRevengArgs(); args.setDbSchema(SCHEMA); args.setInputPath(new File("./src/test/resources/reveng/db2look/input/db2input.txt")); args.setGenerateBaseline(false); args.setOutputPath(outputDir); new Db2DbPlatform().getDdlReveng().reveng(args); DirectoryAssert.assertDirectoriesEqual(new File("./src/test/resources/reveng/db2look/expected"), new File(outputDir, "final")); }
protected static String getSchemaObjectWithPrefixPattern(String startQuoteStr, String endQuoteStr, String objectNamePrefix) { return "(?:" + namePattern(startQuoteStr, endQuoteStr) + "\\.)?" + nameWithPrefixPattern(startQuoteStr, endQuoteStr, objectNamePrefix); }
protected static String getObjectPattern(String startQuoteStr, String endQuoteStr) { return namePattern(startQuoteStr, endQuoteStr); }
@Test @Override public void testReverseEngineeringFromFile() throws Exception { File outputDir = new File("./target/ddlreveng/execute"); FileUtils.deleteDirectory(outputDir); AquaRevengArgs args = new AquaRevengArgs(); args.setDbSchema("dbdeploy01"); args.setInputPath(new File("./src/test/resources/reveng/ddlgen/input/ase-ddlgen-input.txt")); args.setGenerateBaseline(false); args.setOutputPath(outputDir); new AseDbPlatform().getDdlReveng().reveng(args); DirectoryAssert.assertDirectoriesEqual(new File("./src/test/resources/reveng/ddlgen/expected"), new File(outputDir, "final")); } }
protected static String getSchemaObjectPattern(String startQuoteStr, String endQuoteStr) { return "(?:" + namePattern(startQuoteStr, endQuoteStr) + "\\.)?" + namePattern(startQuoteStr, endQuoteStr); }
@Test @Override public void testReverseEngineeringFromFile() throws Exception { File outputDir = new File("./target/ddlreveng/execute"); FileUtils.deleteDirectory(outputDir); AquaRevengArgs args = new AquaRevengArgs(); args.setDbSchema("dbdeploy01"); args.setInputPath(new File("./src/test/resources/reveng/ddlgen/input/ase-ddlgen-input.txt")); args.setGenerateBaseline(false); args.setOutputPath(outputDir); new AseDbPlatform().getDdlReveng().reveng(args); DirectoryAssert.assertDirectoriesEqual(new File("./src/test/resources/reveng/ddlgen/expected"), new File(outputDir, "final")); } }
protected static String getObjectPattern(String startQuoteStr, String endQuoteStr) { return namePattern(startQuoteStr, endQuoteStr); }
@Test public void testInstructions() throws Exception { File outputDir = new File("./target/ddlgen/instructions"); FileUtils.deleteDirectory(outputDir); AquaRevengArgs args = new AquaRevengArgs(); args.setDbSchema("dbdeploy01"); args.setGenerateBaseline(false); args.setOutputPath(outputDir); new AseDbPlatform().getDdlReveng().reveng(args); }
protected static String getSchemaObjectPattern(String startQuoteStr, String endQuoteStr) { return "(?:" + namePattern(startQuoteStr, endQuoteStr) + "\\.)?" + namePattern(startQuoteStr, endQuoteStr); }
@Test public void testInstructions() throws Exception { File outputDir = new File("./target/ddlgen/instructions"); FileUtils.deleteDirectory(outputDir); AquaRevengArgs args = new AquaRevengArgs(); args.setDbSchema("dbdeploy01"); args.setGenerateBaseline(false); args.setOutputPath(outputDir); new AseDbPlatform().getDdlReveng().reveng(args); }
@Test public void testInstructions() throws Exception { AquaRevengArgs args = new AquaRevengArgs(); args.setDbSchema(SCHEMA); args.setGenerateBaseline(false); args.setOutputPath(new File("./target/db2revenginterm.txt")); new Db2DbPlatform().getDdlReveng().reveng(args); }