Git Product home page Git Product logo

typeorm-model-generator's Introduction

typeorm-model-generator

Greenkeeper badge 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]
  --noConfig      Doesn't create tsconfig.json and ormconfig.json
                                                      [boolean] [default: false]
  --cf, --case-file      Convert file names to specified case
                 [choices: "pascal", "param", "camel", "none"] [default: "none"]
  --ce, --case-entity    Convert class names to specified case
                          [choices: "pascal", "camel", "none"] [default: "none"]
  --cp, --case-property  Convert property names to specified case
                          [choices: "pascal", "camel", "none"] [default: "none"]

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
      

typeorm-model-generator's People

Contributors

greenkeeper[bot] avatar greenkeeperio-bot avatar kononnable avatar miltonhowe avatar moshensky avatar timonvs avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.