Go to file
2017-11-06 19:45:23 -08:00
bin readme, preparation to npm publish 2017-07-20 23:16:55 +02:00
src Adding some postgres specific types to the postgres driver 2017-11-06 19:45:23 -08:00
test #3 Support for connecting over SSL 2017-10-15 18:58:17 +02:00
.gitignore readme, preparation to npm publish 2017-07-20 23:16:55 +02:00
.npmignore readme, preparation to npm publish 2017-07-20 23:16:55 +02:00
.travis.yml #3 Support for connecting over SSL 2017-10-15 18:58:17 +02:00
codecov.yml codecov fix3 2017-05-03 22:20:50 +02:00
docker-compose.yml basic support for typeorm 0.1.0-alpha.50; package updates 2017-10-08 21:48:21 +02:00
LICENSE Initial commit 2017-03-23 20:52:39 +01:00
package-lock.json 0.2.2 2017-10-15 21:20:45 +02:00
package.json 0.2.2 2017-10-15 21:20:45 +02:00
README.md readme updates 2017-10-15 19:16:53 +02:00
tsconfig.json #2 fixing new line character on Mac 2017-09-18 21:01:27 +02:00
typings.json #3 Support for connecting over SSL 2017-10-15 18:58:17 +02:00

typeorm-model-generator

Build Status npm version codecov

Generates models for TypeORM from existing databases.
Suported db engines:

  • Microsoft SQL Server
  • PostgreSQL
  • MySQL
  • MariaDB

Installation

Global module

To install module globally simply type npm i -g typeorm-model-generator in your console.

Npx way

Thanks to npx you can use npm modules without polluting global installs. So nothing to do here :)

To use npx you need to use npm at version at least 5.2.0. Try updating your npm by npm i -g npm

Usage

Usage: typeorm-model-generator -h <host> -d <database> -p [port] -u <user> -x
[password] -e [engine]

Options:
  -h, --host      IP adress/Hostname for database server.             [required]
  -d, --database  Database name.                                      [required]
  -u, --user      Username for database server.                       [required]
  -x, --pass      Password for database server.                       [required]
  -p, --port      Port number for database server.
  -e, --engine    Database engine.
           [choices: "mssql", "postgres", "mysql", "mariadb"] [default: "mssql"]
  -o, --output    Where to place generated models.
  -s, --schema    Schema name to create model from. Only for mssql and postgres.
  --ssl                                               [boolean] [default: false]

Examples

  • Creating model from local MSSQL database
    • Global module
      typeorm-model-generator -h localhost -d tempdb -u sa -x !Passw0rd -e mssql -o .\
      
    • Npx Way
      npx typeorm-model-generator -h localhost -d tempdb -u sa -x !Passw0rd -e mssql -o .\
      
  • Creating model from local Postgres database, public schema with ssl connection
    • Global module
      typeorm-model-generator -h localhost -d postgres -u postgres -x !Passw0rd -e postgres -o .\ -s public --ssl
      
    • Npx Way
      npx typeorm-model-generator -h localhost -d postgres -u postgres -x !Passw0rd -e postgres -o .\ -s public --ssl