Create a database (schema) and a minimal set of DB object for a UnityBase ORM
Usage from a command line:
ubcli initDB -?
ubcli initDB -u admin -p admin -dba postgres -dbaPwd postgreDBAPasswordUsage from a code:
const initDB = require('@unitybase/ubcli/initDB')
let options = {
host: 'http://localhost:888',
user: 'admin',
pwd: 'admin',
clientIdentifier: 3,
dropDatabase: true,
createDatabase: true,
dba: 'postgres',
dbaPwd: 'postgreDBAPassword'
}
initDB(options)If DBA already create a database set both dropDatabase & createDatabase to false
Methods
initDB(cfg)
inner
Arguments:
-
cfg (Object)
Properties
-
[clientIdentifier=3] (Number)  Identifier of the client.
Must be between 2 and 8999. Number 1 is for UnityBase developer, 3 for test.
Numbers > 100 is for real installations
-
[dropDatabase=false] (Boolean)  Drop a database/schema first
-
[createDatabase=false] (Boolean)  Create a new database/schema.
-
[dba] (String)  A DBA name. Used in case createDatabase=true
-
[dbaPwd] (String)  A DBA password. Used in case createDatabase=true
cfg (Object)
Properties
-
[clientIdentifier=3](Number) Identifier of the client. Must be between 2 and 8999. Number 1 is for UnityBase developer, 3 for test. Numbers > 100 is for real installations -
[dropDatabase=false](Boolean) Drop a database/schema first -
[createDatabase=false](Boolean) Create a new database/schema. -
[dba](String) A DBA name. Used in casecreateDatabase=true -
[dbaPwd](String) A DBA password. Used in casecreateDatabase=true