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

dbschema-parser-cli

v1.2.3

Published

Command line interface for dbschema-parser

Downloads

20

Readme

dbschema-parser-cli

Command line interface for dbschema-parser. Generates database-specific resource files from the .dbs files output by Wise Coders Solutions' DbSchema Diagram Designer and Query Tool.

Limitations

Currently, the parser only generates from MySql to Mongoose (MongoDB). The CLI is meant to be plugable, however only one generator has been created so far (dbschema-mongoose).

Installation

npm install -g dbschema-parser-cli

Usage

Options:

-d | --database : Selected database (default: all)
-e | --enhance : Use enhanced output (if available) (default: false)
-f | --format : Output format.  (default: mongoose)
-i | --input  : (required) Source DbSchema file.
-o | --output : Output folder path.  (default: ./generated/%datetime%)
-r | --reduce : Reduce output path for selected objects (default: false)
-s | --schema : Selected schema (default: all)
-I | --index : Generate index files (default: false)
-O | --overwrite : Overwrite existing files (default: false)

Example Usage:

Important: The following examples were generated with the dbschema-mongoose generator. Other generates will output different results.

Minimal Syntax:

The only required parameter is the input file (-i or --input):

dbschema -i ../dbschema-parser/examples/geography/resources.dbs

Note only the essential files are generated in a hierarchal structure:

\ generated
+- \ 20170717211353
      \ resources
         \ geography
         +- city.js
            country.js
            postal_code.js
            state.js
            

Generating Index Files:

Index files are generated by adding the -I (or --index) switch:

dbschema -I -i ../dbschema-parser/examples/geography/resources.dbs

Generates the following Mongoose / MongoDB model files:

\ generated
+- \ 20170717211353
   +- index.js
      \ resources
      +- index.js
         \ geography
         +- city.js
            country.js
            index.js
            postal_code.js
            state.js
            

Reducing Output Path & Limiting Selections:

Including the -d (or --database), with the name of the database, causes all other databases to be ignored. Adding the -r (or --reduce) switch prevents unnecessary folders from being created, thus creating a flatter output structure:

dbschema -r -d resources -I -i ../dbschema-parser/examples/geography/resources.dbs

The top-most folder was not output because of the -r (or --reduce) switch. Since only database was output there was no need for an index file or subdirectory:

\ generated
+- \ 20170717211353
    +- index.js
       \ geography
       +- city.js
          country.js
          index.js
          postal_code.js
          state.js
            
Extreme Minimal Output:

Similar to above, adding the -s (or --schema) switch, with the schema name, causes all other schemas to be ignored (-d is required in this scenario):

dbschema -r -d resources -s geography -I -i ../dbschema-parser/examples/geography/resources.dbs

Specifying both the schema and database, along with the -r (or --reduce) switch causes minimal output to be generated and the flattest structure:

\ generated
+- \ 20170717211353
   +- city.js
      country.js
      index.js
      postal_code.js
      state.js
            

About MEAN Factory

MEAN Factory is an initiative to help teach software development focusing on the MEAN Stack (Mongo, ExpressJS, AngularJS, NodeJS). For more information, visit our web site or email us:

http://meanfactory.com
[email protected]