/** * @deprecated Use {@link #getOutputPath()} */ @Deprecated public File getOutputDir() { return this.getOutputPath(); }
/** * @deprecated Use {@link #getOutputPath()} */ @Deprecated public File getOutputDir() { return this.getOutputPath(); }
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); } }
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); } }
@Override protected File printInstructions(PrintStream out, AquaRevengArgs args) { DbEnvironment env = getDbEnvironment(args); JdbcDataSourceFactory jdbcFactory = new HsqlJdbcDataSourceFactory(); DataSource ds = jdbcFactory.createDataSource(env, new Credential(args.getUsername(), args.getPassword()), 1); JdbcHelper jdbc = new JdbcHelper(null, false); Path interim = new File(args.getOutputPath(), "interim").toPath(); interim.toFile().mkdirs(); try (Connection conn = ds.getConnection()) { // https://docs.oracle.com/database/121/ARPLS/d_metada.htm#BGBJBFGE // Note - can't remap schema name, object name, tablespace name within JDBC calls; we will leave that to the existing code in AbstractDdlReveng File outputFile = interim.resolve("output.sql").toFile(); outputFile.delete(); // clean before creating jdbc.update(conn, "SCRIPT '" + outputFile.getCanonicalPath() + "'"); } catch (SQLException | IOException e) { throw new RuntimeException(e); } return interim.toFile(); } }
@Override protected File printInstructions(PrintStream out, AquaRevengArgs args) { DbEnvironment env = getDbEnvironment(args); JdbcDataSourceFactory jdbcFactory = new HsqlJdbcDataSourceFactory(); DataSource ds = jdbcFactory.createDataSource(env, new Credential(args.getUsername(), args.getPassword()), 1); JdbcHelper jdbc = new JdbcHelper(null, false); Path interim = new File(args.getOutputPath(), "interim").toPath(); interim.toFile().mkdirs(); try (Connection conn = ds.getConnection()) { // https://docs.oracle.com/database/121/ARPLS/d_metada.htm#BGBJBFGE // Note - can't remap schema name, object name, tablespace name within JDBC calls; we will leave that to the existing code in AbstractDdlReveng File outputFile = interim.resolve("output.sql").toFile(); outputFile.delete(); // clean before creating jdbc.update(conn, "SCRIPT '" + outputFile.getCanonicalPath() + "'"); } catch (SQLException | IOException e) { throw new RuntimeException(e); } return interim.toFile(); } }
JdbcHelper jdbc = new JdbcHelper(null, false); Path interim = new File(args.getOutputPath(), "interim").toPath(); interim.toFile().mkdirs(); try (Connection conn = ds.getConnection();
JdbcHelper jdbc = new JdbcHelper(null, false); Path interim = new File(args.getOutputPath(), "interim").toPath(); interim.toFile().mkdirs(); try (Connection conn = ds.getConnection();
private String getCommandWithDefaults(AquaRevengArgs args, String username, String password, String dbHost, String dbSchema, String outputFile) { return " SqlServerDdlReveng " + " " + ObjectUtils.defaultIfNull(args.getOutputPath(), outputFile) + " " + ObjectUtils.defaultIfNull(args.getDbHost(), dbHost) + " " + ObjectUtils.defaultIfNull(args.getDbSchema(), dbSchema) + " " + ObjectUtils.defaultIfNull(args.getUsername(), username) + " " + ObjectUtils.defaultIfNull(args.getPassword(), password); } }
private String getCommandWithDefaults(AquaRevengArgs args, String username, String password, String dbServer, String dbSchema, String outputFile) { return " db2look " + "-d " + ObjectUtils.defaultIfNull(args.getDbServer(), dbServer) + " " + "-z " + ObjectUtils.defaultIfNull(args.getDbSchema(), dbSchema) + " " + "-i " + ObjectUtils.defaultIfNull(args.getUsername(), username) + " " + "-w " + ObjectUtils.defaultIfNull(args.getPassword(), password) + " " + "-o " + ObjectUtils.defaultIfNull(args.getOutputPath(), outputFile) + " " + "-cor -e -td ~ "; } }
private String getCommandWithDefaults(AquaRevengArgs args, String username, String password, String dbServer, String dbSchema, String outputFile) { return " db2look " + "-d " + ObjectUtils.defaultIfNull(args.getDbServer(), dbServer) + " " + "-z " + ObjectUtils.defaultIfNull(args.getDbSchema(), dbSchema) + " " + "-i " + ObjectUtils.defaultIfNull(args.getUsername(), username) + " " + "-w " + ObjectUtils.defaultIfNull(args.getPassword(), password) + " " + "-o " + ObjectUtils.defaultIfNull(args.getOutputPath(), outputFile) + " " + "-cor -e -td ~ "; } }
private String getCommandWithDefaults(AquaRevengArgs args, String username, String password, String dbHost, String dbSchema, String outputFile) { return " SqlServerDdlReveng " + " " + ObjectUtils.defaultIfNull(args.getOutputPath(), outputFile) + " " + ObjectUtils.defaultIfNull(args.getDbHost(), dbHost) + " " + ObjectUtils.defaultIfNull(args.getDbSchema(), dbSchema) + " " + ObjectUtils.defaultIfNull(args.getUsername(), username) + " " + ObjectUtils.defaultIfNull(args.getPassword(), password); } }
new RevengWriter().write(platform, changeEntries, new File(args.getOutputPath(), "final"), args.isGenerateBaseline(), RevengWriter.defaultShouldOverwritePredicate(), args.getJdbcUrl(), args.getDbHost(), args.getDbPort(), args.getDbServer(), args.getExcludeObjects());
new RevengWriter().write(platform, changeEntries, new File(args.getOutputPath(), "final"), args.isGenerateBaseline(), RevengWriter.defaultShouldOverwritePredicate(), args.getJdbcUrl(), args.getDbHost(), args.getDbPort(), args.getDbServer(), args.getExcludeObjects());
private String getCommandWithDefaults(AquaRevengArgs args, String username, String password, String dbHost, String dbPort, String dbName, String dbSchema, String outputDirectory) { return "pg_dump -O --disable-dollar-quoting -s" + " -h " + ObjectUtils.defaultIfNull(args.getDbHost(), dbHost) + " -p " + ObjectUtils.defaultIfNull(args.getDbPort(), dbPort) + " --username=" + ObjectUtils.defaultIfNull(args.getUsername(), username) + " -d " + ObjectUtils.defaultIfNull(args.getDbServer(), dbName) + " -n " + ObjectUtils.defaultIfNull(args.getDbSchema(), dbSchema) + " -f " + ObjectUtils.defaultIfNull(args.getOutputPath(), outputDirectory); } }
private String getCommandWithDefaults(AquaRevengArgs args, String username, String password, String dbHost, String dbPort, String dbName, String dbSchema, String outputDirectory) { return "pg_dump -O --disable-dollar-quoting -s" + " -h " + ObjectUtils.defaultIfNull(args.getDbHost(), dbHost) + " -p " + ObjectUtils.defaultIfNull(args.getDbPort(), dbPort) + " --username=" + ObjectUtils.defaultIfNull(args.getUsername(), username) + " -d " + ObjectUtils.defaultIfNull(args.getDbServer(), dbName) + " -n " + ObjectUtils.defaultIfNull(args.getDbSchema(), dbSchema) + " -f " + ObjectUtils.defaultIfNull(args.getOutputPath(), outputDirectory); } }
new File(args.getOutputPath(), env.getPlatform().getChangeType(ChangeType.STATICDATA_STR).getDirectoryName()), args.getUpdateTimeColumns(), csvFormat);
new File(args.getOutputPath(), env.getPlatform().getChangeType(ChangeType.STATICDATA_STR).getDirectoryName()), args.getUpdateTimeColumns(), csvFormat);