Tool for creation of database schemas and others boring jobs usefull for ideman
and ideman-acl
node modules.
It supports postgres
, mysql
, mariasql
and sqlite3
.
In your project root run from command line:
$ npm install -g ideman-cli
ideman-cli
provides a set of interactive commands that can be used from command line:
$ ideman-cli <command> [arguments]
The availables commands are:
Initializes a configuration for database connection.
Example
$ ideman-cli config
Initializes tables names.
Example
$ ideman-cli tables
Resets all configurations to default.
Example
$ ideman-cli reset
Shows a JSON object with current configurations.
Example
$ ideman-cli list [development|production]
Shows the current environment.
Example
$ ideman-cli env
Switches environment.
Example
$ ideman-cli switch
Initializes database schemas for specified application. If force
was specified, tables will be dropped.
If application
was not specified, it takes the application value set into configuration.
Example
$ ideman-cli init [ideman|ideman-acl] [force]
Inserts a new entity into database.
Example
$ ideman-cli insert [user|client|token|code|role|userRole|permission|resource|policy]
Removes an existing entity from database.
Example
$ ideman-cli delete [user|client|token|code|role|userRole|permission|resource|policy]
Import entities from a JSON file. File to import must be in this format:
{
"data": [
{
"entity": "user",
"columns": {
"username": "admin",
"password": "$2a$05$Sbvj/0fQB/H/GaQZJg88iOP/ppZXTEtwCEF1Iff0hCt1t/PcJIfDa",
"email": "[email protected]",
"firstName": "super",
"lastName": "administrator"
},
"returning": "id"
},
{
"entity": "client",
"columns": {
"name": "dashboard",
"secret": "a1l4PsbkgQHgZzaN1lFQSw==",
"description": "the dashboard client application",
"domain": "localhost"
},
"returning": "id"
}
]
}
Example
$ ideman-cli import [path]
Cyphers a text.
Example
$ ideman-cli cypher
Decyphers a text.
Example
$ ideman-cli decypher
Crypts a text.
Example
$ ideman-cli crypt
- knex by Tim Griesser
The MIT License
Copyright (c) 2016 Michele Andreoli http://thinkingmik.com