vizql
v0.0.3
Published
Express middleware to visualize sequalize schemas.
Downloads
7
Maintainers
Readme
VizQL
Sequelize model schema visualizer.
Features
- VizQL reads a Sequelize schema from a database connection and renders a visualization of the schema on an express route chosen by the user.
Installation and Use
Install using NPM.
npm install vizql
Then use it in your Node.js as follows:
const express = require('express');
const app = express();
const vizql = require('vizql');
const Sequelize = require('sequelize');
const sqlite3 = require('sqlite3');
const exampleDB = new Sequelize('mainDB', null, null, {
dialect: "sqlite",
storage: ':memory:',
});
// Add Sequalize models where appropriate
const User = exampleDB.define('users', {
id: { type: Sequelize.INTEGER, primaryKey: true, autoIncrement: true },
name: Sequelize.STRING
});
app.get('/vizql', vizql(exampleDb).pageRoute);
app.listen(3000);
module.exports = app;