Go to file
2017-08-14 20:06:54 +02:00
bin readme, preparation to npm publish 2017-07-20 23:16:55 +02:00
src added support for MariaDB; formating in some files 2017-08-14 19:07:13 +02:00
test fixing travis CI build 2017-08-14 19:51:41 +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 fixing travis CI build v2 2017-08-14 20:06:54 +02:00
codecov.yml codecov fix3 2017-05-03 22:20:50 +02:00
docker-compose.yml changed building testing environment to docker-compose 2017-08-14 19:46:09 +02:00
LICENSE Initial commit 2017-03-23 20:52:39 +01:00
package-lock.json added MySQL support 2017-08-14 16:38:18 +02:00
package.json added MySQL support 2017-08-14 16:38:18 +02:00
README.md readme, preparation to npm publish 2017-07-20 23:16:55 +02:00
tsconfig.json extracting dist bin 2017-07-20 21:39:08 +02:00
typings.json some logic in mssqldriver 2017-03-27 00:11:26 +02:00

typeorm-model-generator

Build Status npm version codecov

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

  • Microsoft SQL Server
  • PostgreSQL

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"]
  -o, --output    Where to place generated models.

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
    • Global module
      typeorm-model-generator -h localhost -d postgres -u postgres -x !Passw0rd -e postgres -o .\
      
    • Npx Way
      npx typeorm-model-generator -h localhost -d postgres -u postgres -x !Passw0rd -e postgres -o .\