PHPackages                             fi/mysql-workbench-schema-exporter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. fi/mysql-workbench-schema-exporter

Abandoned → [mysql-workbench-schema-exporter/mysql-workbench-schema-exporter](/?search=mysql-workbench-schema-exporter%2Fmysql-workbench-schema-exporter)Library[Database &amp; ORM](/categories/database)

fi/mysql-workbench-schema-exporter
==================================

MySQL Workbench Schema Exporter

4.0.0(4y ago)0709MITPHPPHP &gt;=5.4.0

Since Apr 4Pushed 4y agoCompare

[ Source](https://github.com/ComuneFI/mysql-workbench-schema-exporter)[ Packagist](https://packagist.org/packages/fi/mysql-workbench-schema-exporter)[ Docs](https://github.com/comunedifirenze/mysql-workbench-schema-exporter)[ RSS](/packages/fi-mysql-workbench-schema-exporter/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (30)Used By (0)

README
======

[](#readme)

What is MySQL Workbench Schema Exporter?
----------------------------------------

[](#what-is-mysql-workbench-schema-exporter)

[MySQL Workbench](http://www.mysql.com/products/workbench/) Schema Exporter is a library to transform the MySQL Workbench model (`*.mwb`) to useful another schemas.

It is inspired by [mysql-workbench-doctrine-plugin](http://code.google.com/p/mysql-workbench-doctrine-plugin/).

Currently, MySQL Workbench Schema Exporter can export the model to various schemas using a formatter plugin:

- Doctrine 1.0 [YAML Schema](http://docs.doctrine-project.org/projects/doctrine1/en/latest/en/manual/yaml-schema-files.html).
- Doctrine 2.0 [YAML Schema](http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/yaml-mapping.html), [Annotation Classes](http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/annotations-reference.html)or Annotation Classes with [Zend Framework 2](http://framework.zend.com/)[Input Filter support](http://framework.zend.com/manual/2.1/en/modules/zend.input-filter.intro.html).
- [Zend DbTable](http://framework.zend.com/manual/1.12/en/zend.db.table.html).
- Zend Rest Controller.
- Sencha ExtJS3 Model.
- Sencha [ExtJS4 Model](http://www.sencha.com/products/extjs/).
- Propel [XML Schema](http://www.propelorm.org/reference/schema) and YAML Schema.
- [Node Sequelize](https://sequelize.org).

The actual conversion to another schema is done using an exporter. These plugins are available in subprojects:

- [Doctrine1 Exporter](https://github.com/mysql-workbench-schema-exporter/doctrine1-exporter)
- [Doctrine2 Exporter](https://github.com/mysql-workbench-schema-exporter/doctrine2-exporter)
- [Propel1 Exporter](https://github.com/mysql-workbench-schema-exporter/propel1-exporter)
- [Zend Framework 1 Exporter](https://github.com/mysql-workbench-schema-exporter/zend1-exporter)
- [Node Exporter](https://github.com/mysql-workbench-schema-exporter/node-exporter)

Prerequisites
-------------

[](#prerequisites)

- PHP 5.4+
- Composer to install the dependencies

Installation
------------

[](#installation)

### Using Composer

[](#using-composer)

1. In your project directory issue:

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

```

2. You then can invoke the CLI script using `vendor/bin/mysql-workbench-schema-export`.
3. You can directly require an exporter for your project:

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

```

### Stand alone

[](#stand-alone)

1. Get the source code using Git or [download](https://github.com/johmue/mysql-workbench-schema-exporter/releases) from Github.
2. Get [composer](https://getcomposer.org/).
3. Install dependencies:

```
php composer.phar install

```

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

Configuring MySQL Workbench Schema Exporter
-------------------------------------------

[](#configuring-mysql-workbench-schema-exporter)

MySQL Workbench Schema Exporter can be configured at runtime using methods:

- Setup options.
- Model comment, either applied to table, column, or foreign key object.

Both methods accept different options, and generally divided as common options and exporter (formatter) specific options.

### Common Setup Options

[](#common-setup-options)

General options applied to all formatter.

- `filename`

    The output filename format, use the following tag `%schema%`, `%table%`, `%entity%`, and `%extension%` to allow the filename to be replaced with contextual data.

    Default is `%entity%.%extension%`.
- `indentation`

    The indentation size for generated code.
- `useTabs`

    Use tabs for indentation instead of spaces. Setting this option will ignore the `indentation`-option.
- `eolDelimeter`

    EOL type for generated code. Supported EOLs are `win` and `unix`.
- `addGeneratorInfoAsComment`

    Add generator information to the generated code as a comment.

    Default is `true`.
- `skipPluralNameChecking`

    Skip checking the plural name of model and leave as is, useful for non English table names.

    Default is `false`.
- `backupExistingFile`

    If target already exists create a backup before replacing the content.

    Default is `true`.
- `enhanceManyToManyDetection`

    If enabled, many to many relations between tables will be added to generated code.

    Default is `true`.
- `sortTablesAndViews`

    If enabled, sorting of tables and views is performed prior to code generation for each table and view. For table, it sorted by table model name and for view sorted by view model name.

    Default is `true`.
- `exportOnlyTableCategorized`

    If specified, only export the tables if its category matched.
- `logToConsole`

    If enabled, output the log to console.

    Default is `false`.
- `logFile`

    If specified, output the log to a file. If this option presence, option `logToConsole` will be ignored instead.

    Default is `empty`.
- `stripMultipleUnderscores`

    If enabled, consider multiple underscores as single ones so for example, a table named `user__group`will still produce a `UserGroup` entity.

    Default is `false`.
- `asIsUserDatatypePrefix`

    This option gives the ability to bypass user type convertion and forward user type to models, as is.

    For example, if defined to `_`, and a user type `_BOOLEAN` is defined in MySQL Workbench (resolving to `TINYINT(1)`, for example, but no matter), then the model field will have `BOOLEAN`.

    It is usefull for non MySQL types like `BOOLEAN` or `JSONB` that certain ORMs can handle.

    Default is `""` (disabled).

### Common Model Comment Behavior

[](#common-model-comment-behavior)

- `{MwbExporter:external}true{/MwbExporter:external}` (applied to Table, View)

    Mark table/view as external to skip table/view code generation. For Doctrine use `{d:external}true{/d:external}` instead.
- `{MwbExporter:category}mycategory{/MwbExporter:category}` (applied to Table)

    Table category used to groups the table for sorting. This way, generated table output can be sorted as you need such as in Propel YAML schema (obviously useful for exporter which results in single file output).

Formatter Setup Options
-----------------------

[](#formatter-setup-options)

- [Doctrine 2 Annotation, YAML and ZF2 Input Filter](https://github.com/mysql-workbench-schema-exporter/doctrine2-exporter#formatter-setup-options)
- [Doctrine 1 YAML](https://github.com/mysql-workbench-schema-exporter/doctrine1-exporter#formatter-setup-options)
- [Propel 1 YAML and XML](https://github.com/mysql-workbench-schema-exporter/propel1-exporter#formatter-setup-options)
- [Zend 1 Rest and DbTable](https://github.com/mysql-workbench-schema-exporter/zend1-exporter#formatter-setup-options)
- [NodeJS Sequelize ](https://github.com/mysql-workbench-schema-exporter/node-exporter#formatter-setup-options)
- [Sencha ExtJS3 and ExtJS4](https://github.com/mysql-workbench-schema-exporter/sencha-exporter#formatter-setup-options)

Command Line Interface (CLI)
----------------------------

[](#command-line-interface-cli)

The `mysql-workbench-schema-export` command helps export a workbench schema model directly from command line. It has feature to customize export configuration before exporting. By default, it will use config file `export.json` located in the current directory to supply the parameter if it find it. To disable this behaviour, see the option below.

Command usage:

```
php bin/mysql-workbench-schema-export [options] FILE [DEST]

```

Where:

- `FILE`

    The MySQL Workbench model file to export.
- `DEST`

    The destination directory (optional), if not specified current directory assumed.

Options:

- `--export=type`

Choose the result of the export, supported type can be obtained using `--list-exporter`. If this option is omitted and no config file found, the CLI will prompt to choose which exporter to use.

- `--config=file`

Read export parameters from file (in JSON format).

- `--saveconfig`

Save export parameters to file `export.json`, later can be used as value for `--config=file`.

- `--list-exporter`

Show all available exporter.

- `--no-auto-config`

Disable automatic config file lookup.

- `--zip`

Compress the result.

- `--help`

Show the usage (or suppress any parameters).

Sample usage:

```
php bin/mysql-workbench-schema-export --export=doctrine1-yaml example/data/test.mwb ./generated
php bin/mysql-workbench-schema-export --zip example/data/test.mwb

```

Sample export parameters (JSON) for doctrine2-annotation:

```
{
    "export": "doctrine2-annotation",
    "zip": false,
    "dir": "temp",
    "params": {
        "backupExistingFile": true,
        "skipPluralNameChecking": false,
        "enhanceManyToManyDetection": true,
        "bundleNamespace": "",
        "entityNamespace": "",
        "repositoryNamespace": "",
        "useAnnotationPrefix": "ORM\\",
        "useAutomaticRepository": true,
        "indentation": 4,
        "filename": "%entity%.%extension%",
        "quoteIdentifier": false
    }
}

```

Using MySQL Workbench Schema Exporter as Library
------------------------------------------------

[](#using-mysql-workbench-schema-exporter-as-library)

If you want to use MySQL Workbench Schema Exporter as a library for other project. See the included usage in the `example` folder.

Test Database
-------------

[](#test-database)

- [Sakila Sample Database documentation](http://dev.mysql.com/doc/sakila/en/index.html).
- [Sakila Sample Database download](http://dev.mysql.com/doc/index-other.html).

Links
-----

[](#links)

- [MySQL Workbench](http://wb.mysql.com/)
- [Doctrine Project](http://www.doctrine-project.org/)
- [Symfony Project](http://www.symfony.com/)
- [Sencha - Open source FAQ](http://www.sencha.com/legal/open-source-faq/)

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~105 days

Recently: every ~0 days

Total

27

Last Release

1684d ago

Major Versions

v2.1.6 → v3.0.02016-01-09

1.0.3 → 4.x-dev2021-09-29

PHP version history (2 changes)v2.0.0PHP &gt;=5.3.0

v3.0.0PHP &gt;=5.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/c06b49229d24051e9fe509791b9606e70bc5757d6d395a2c241350e2e2133a91?d=identicon)[comunefi\_spa](/maintainers/comunefi_spa)

---

Top Contributors

[![tohenk](https://avatars.githubusercontent.com/u/350747?v=4)](https://github.com/tohenk "tohenk (246 commits)")[![johmue](https://avatars.githubusercontent.com/u/281784?v=4)](https://github.com/johmue "johmue (135 commits)")[![rvock](https://avatars.githubusercontent.com/u/209159?v=4)](https://github.com/rvock "rvock (31 commits)")[![meven](https://avatars.githubusercontent.com/u/620941?v=4)](https://github.com/meven "meven (20 commits)")[![armandabric](https://avatars.githubusercontent.com/u/95120?v=4)](https://github.com/armandabric "armandabric (14 commits)")[![DamienHarper](https://avatars.githubusercontent.com/u/2448660?v=4)](https://github.com/DamienHarper "DamienHarper (11 commits)")[![allansun](https://avatars.githubusercontent.com/u/20531?v=4)](https://github.com/allansun "allansun (10 commits)")[![fgaudin](https://avatars.githubusercontent.com/u/118230?v=4)](https://github.com/fgaudin "fgaudin (6 commits)")[![cesaric](https://avatars.githubusercontent.com/u/261590?v=4)](https://github.com/cesaric "cesaric (5 commits)")[![Easen](https://avatars.githubusercontent.com/u/111948?v=4)](https://github.com/Easen "Easen (5 commits)")[![Yoda-BZH](https://avatars.githubusercontent.com/u/751889?v=4)](https://github.com/Yoda-BZH "Yoda-BZH (4 commits)")[![verticka](https://avatars.githubusercontent.com/u/391828?v=4)](https://github.com/verticka "verticka (3 commits)")[![drowe](https://avatars.githubusercontent.com/u/234503?v=4)](https://github.com/drowe "drowe (2 commits)")[![molaux](https://avatars.githubusercontent.com/u/9612549?v=4)](https://github.com/molaux "molaux (2 commits)")[![drymek](https://avatars.githubusercontent.com/u/492240?v=4)](https://github.com/drymek "drymek (2 commits)")[![adrianbardan](https://avatars.githubusercontent.com/u/2693350?v=4)](https://github.com/adrianbardan "adrianbardan (2 commits)")[![doncem](https://avatars.githubusercontent.com/u/1420191?v=4)](https://github.com/doncem "doncem (1 commits)")[![sdenev](https://avatars.githubusercontent.com/u/1447657?v=4)](https://github.com/sdenev "sdenev (1 commits)")[![slknijnenburg](https://avatars.githubusercontent.com/u/1593444?v=4)](https://github.com/slknijnenburg "slknijnenburg (1 commits)")[![bitcod3r](https://avatars.githubusercontent.com/u/4358449?v=4)](https://github.com/bitcod3r "bitcod3r (1 commits)")

---

Tags

clidatabasemysqldoctrinezendextjspropelsequelizejsmysql workbench

### Embed Badge

![Health badge](/badges/fi-mysql-workbench-schema-exporter/health.svg)

```
[![Health](https://phpackages.com/badges/fi-mysql-workbench-schema-exporter/health.svg)](https://phpackages.com/packages/fi-mysql-workbench-schema-exporter)
```

###  Alternatives

[mysql-workbench-schema-exporter/mysql-workbench-schema-exporter

MySQL Workbench Schema Exporter

488188.5k10](/packages/mysql-workbench-schema-exporter-mysql-workbench-schema-exporter)[scienta/doctrine-json-functions

A set of extensions to Doctrine that add support for json query functions.

58523.9M35](/packages/scienta-doctrine-json-functions)[mysql-workbench-schema-exporter/doctrine2-exporter

MySQL Workbench Schema Exporter for Doctrine 2

25143.3k2](/packages/mysql-workbench-schema-exporter-doctrine2-exporter)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
