🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@newko/sql-to-model

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@newko/sql-to-model

sql file to model generate

latest
Source
npmnpm
Version
0.1.4
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

Sql(DDL) To Model

Summary

Create a data model using DDL syntax(Using the .sql file extension file)

Support

Database

  • MySql
  • MariaDB

ORM

  • TypeORM

Requirements

  • Node.js v14.+

Install

# npm
$ npm install -g @newko/sql-to-model

# yarn
$ yarn global add @newko/sql-to-model

CLI

$ model-generate -s [*.sql] -t [target directory] -m [model type] -d [database]

Examples

#Options
options :
  -s, --sqlDir <sqlDir> (.sql File Target directory to reference)
  -t, --targetDir <targetDir> (Name of the project you want to create)
  -m, --modelType <modelType> (TypeORM, Sequelize || default option: TypeORM)
  -d, --database <database> (MySql, MariaDB, Postgresql.. || default option: MySql)

#Command
$ model-generate -s ./sql -t ./ryan

$ model-generate -s ./sql -t ./ryan -m TypeORM -d MySql

Keywords

node.js

FAQs

Package last updated on 04 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts