Skip to content

SpoonX/wetland-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wetland-cli

Command line tools for wetland ORM.

Installation

npm i -g wetland-cli

Commands

Run wetland help to find the commands that are at your disposal.

Examples:

  • wetland migrator schema -d (dump the queries for the current schema)
  • wetland migrator schema -r (apply queries for the current schema)
  • wetland migrator status (shows the current status of your migrations)
  • wetland generator entity user username,email,password (use a generator, read below for more info)

Gernerators

Wetland-cli offers support for generators using Boards.

An example generator, one you might want to install as well, is wetland-generator-entity.

npm i -D wetland-generator-entity

You can find a skeleton, as a base to create your own here at wetland-generator-skeleton.

List generators

To list all available generators, run:

wetland generator --help

Example:

$ wetland generator --help

  Usage: wetland-generator [options] [command]


  Commands:

    entity [options] <name>    Generate a new entity
    skeleton [options] <name>  Generate a new greeting file

  Options:

    -h, --help           output usage information
    -V, --version        output the version number
    -c, --config <path>  defaults to $PWD/(wetland.js|wetland.json)

  Examples:

    $ wetland generator entity user -l ts -e -f "username,password:string,email:field({type: text, size: 255})"
    $ wetland generator skeleton greeting -a -x txt

Help for a specific generator

 $ wetland generator entity --help

  Usage: entity [options] <name>

  Generate a new entity

  Options:

    -h, --help                 output usage information
    -l, --language <language>  One of "ts" or "js" for the target language (defaults to js)
    -e, --extend               Set to extend wetland.Entity for .toObject (defaults to false)
    -f, --fields <fields>      Fields to add. E.g. `-f username:string,password:string`
    -i, --interactive          Use interactive mode to design the entity

License

MIT