MySQL Workbench Schema Exporter for Sequelizejs

v3.1.1 2020-07-19 14:04 UTC

This package is auto-updated.

Last update: 2021-08-22 09:08:18 UTC


README

This is an exporter to convert MySQL Workbench Models (*.mwb) to Nodejs Sequelize Schema.

Prerequisites

  • PHP 5.4+
  • Composer to install the dependencies

Installation

php composer.phar require --dev mysql-workbench-schema-exporter/node-exporter

This will install the exporter and also require mysql-workbench-schema-exporter.

You then can invoke the CLI script using vendor/bin/mysql-workbench-schema-export.

Formatter Setup Options

Additionally to the common options of mysql-workbench-schema-exporter these options are supported:

Sequelize Model

Currently, no special options can be configured for Sequelize Model.

Command Line Interface (CLI)

See documentation for mysql-workbench-schema-exporter

Nodejs Usage Example

Sequelize 5

const Sequelize = require('sequelize');

const sequelize = new Sequelize({...});
const MyModel = sequelize.import('./path/to/MyModel');

// do something with MyModel
MyModel.findOne({...}).then((res) => {...});

Sequelize 6

const Sequelize = require('sequelize');

const sequelize = new Sequelize({...});
const MyModel = require('./path/to/MyModel')(sequelize);

// do something with MyModel
MyModel.findOne({...}).then((res) => {...});

Links