npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@steedos/steedos-model-generator

v1.20.0

Published

Generates models for steedos from existing databases.

Downloads

401

Readme

steedos-model-generator

Generates models for Steedos from existing database. Suported db engines:

  • Microsoft SQL Server
  • PostgreSQL
  • MySQL
  • Oracle Database
  • SQLite

Installation

Global module

To install module globally simply type npm i -g @steedos/steedos-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

Database drivers

All database drivers except oracle are installed by default. To use steedos-model-generator with oracle databese you need to install driver with npm i oracledb and configure oracle install client on your machine.

Usage

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

Options:
  --help                 Show help                                     [boolean]
  --version              Show version number                           [boolean]
  -h, --host             IP adress/Hostname for database server
                                                          [default: "127.0.0.1"]
  -d, --database         Database name(or path for sqlite)            [required]
  -u, --user             Username for database server
  -x, --pass             Password for database server              [default: ""]
  -p, --port             Port number for database server
  -e, --engine           Database engine
          [choices: "mssql", "postgres", "mysql", "mariadb", "oracle", "sqlite"]
                                                              [default: "mssql"]
  -o, --output           Where to place generated models
                            [default: "Z:\Repos\steedos-model-generator\output"]
  -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"]
  --lazy                 Generate lazy relations      [boolean] [default: false]
  -a, --active-record    Generate models that use the ActiveRecord syntax
                                                      [boolean] [default: false]
  --namingStrategy       Use custom naming strategy
  --relationIds          Generate RelationId fields   [boolean] [default: false]
  --generateConstructor  Generate constructor allowing partial initialization
                                                      [boolean] [default: false]

Examples

  • Creating model from local MSSQL database
    • Global module
      steedos-model-generator -h localhost -d tempdb -u sa -x !Passw0rd -e mssql -o .
    • Npx Way
      npx steedos-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
      steedos-model-generator -h localhost -d postgres -u postgres -x !Passw0rd -e postgres -o . -s public --ssl
    • Npx Way
      npx steedos-model-generator -h localhost -d postgres -u postgres -x !Passw0rd -e postgres -o . -s public --ssl
  • Creating model from SQLite database
    • Global module
      steedos-model-generator -d "Z:\sqlite.db" -e sqlite -o .
    • Npx Way
      npx steedos-model-generator -d "Z:\sqlite.db" -e sqlite -o .

The steedos-model-generator command will generate the steedos-config.yml and objects folders, which can be copied to your steedos app project and used to launch the project.