Skip to content

Bhanu-code/db-drawer

Repository files navigation

db-drawer

db-drawer

A cli tool for visualising your database schemas. db-drawer checks the data model schemas of your project ("./models") folder and visualises by running on localhost in node environment. it attaches to your project as an npm package.

Currently, we have support for Sequelize, Mongoose, TypeORM, and Prisma.

Refer to Learn.md for building the project: Learn.md

Video demonstration of the project: Demonstration video

Join Our Discord channel: Discord

Installation

Install db-drawer with npm

Local installation

//Install as dev dependency in your project
npm install db-drawer --save-dev

//For sequelize
npx db-draw s

//For mongoose
npx db-draw m

//For TypeORM
npx db-draw t

//For Prisma
npx db-draw p

Global installation

npm install -g db-drawer

cd /path/to/your/project

//For sequelize
db-draw s

//For mongoose
db-draw m

//For TypeORM
db-draw t

//For Prisma
db-draw p

After executing the command, it will run localhost where you can see your schema, relationship and constraints in a tablular format

Screenshots

db-draw with mongoDB db-draw with SQL

Local Setup

Note: [ Don't commit to main branch, always create a seprate branch before raising PR ]

// You will need a demo project that has "/models" folder to see your models visualised.
//To setup the project locally, for the repository and copy the forked copy the https url

//In the terminal write
git clone [repo-url]

cd db-drawer

npm install

// Have a project that has "models" folder
//Install dbdrawer-mongo to the project globally
npm install -g 

// Open the demo project
cd /path/to/your/project

//Run the command for sequelize
db-draw s

//Run the command for mongoose
db-draw m

//Run the command for TypeORM
db-draw t

//Run the command for Prisma
db-draw p

Hit enter and it will run localhost where you can see your schema, relationship and constraints in a tablular format

Create a branch, make changes and raise PR

Contributing

Contributions are always welcome!

See contributing.md for ways to get started.

Please adhere to this project's code of conduct.

License

MIT License