cmd/generateDDL

Command line module.

Check database structure for application domain. Generate DDL (both create and alter) if need and optionally run it

WARNING: do not run this command on production database in automatic mode - always review SQL script manually before run

Author:
  • pavel.mash
Example
/from a command line
 >ub cmd/generateDDL -u admin -p admin -autorun

 //from a script
 var DDLGenerator = require('cmd/generateDDL');
 var options = {
      host: "http://localhost:888",
      user: "admin",
      pwd:  "admin",
      out:  process.cwd(),
      autorun: true
 };
 DDLGenerator(options);

Methods

runDDLGenerator(conn, appConfigopt, inEntities, inModels, outputPath) inner

Arguments:
  1. conn (UBConnection)
  2. [appConfig] (Object)  Optional server config application section (used in auto mode to execute DDL statements)
  3. inEntities (String)
  4. inModels (String)
  5. outputPath (String)

formatAsText(connectionName, connResult) inner

Format a result of runDDLGenerator as a single SQL file
Arguments:
  1. connectionName (String)
  2. connResult (Object)