Skip to content

Commit

Permalink
support config modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
ar committed Sep 29, 2017
1 parent 681f2d8 commit 78c36bf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,17 @@
public class CREATESCHEMA implements CLICommand {
@Override
public void exec(CLIContext cli, String[] args) throws Exception {
String filename = "-"; // defaults to stdout
String filename = "-"; // defaults to stdout '
String configModifier = null;
boolean create = false;
if (args.length > 1)
filename = args[1];
if (args.length > 2)
create = "yes".equalsIgnoreCase(args[2]) || "true".equalsIgnoreCase(args[2]);
try (DB db = new DB()) {
if (args.length > 3)
configModifier = args[3];

try (DB db = new DB(configModifier)) {
db.open();
db.beginTransaction();
db.createSchema(filename, create);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Usage: createschema [filename] [export]
Usage: createschema [filename] [export] [config-modifier]

* 'filename' to store the SQL script (useful in a dry run)
* if 'export' is 'yes', the script will be exported to the database
* optional 'config-modifier'

0 comments on commit 78c36bf

Please # to comment.