- Notifications
You must be signed in to change notification settings - Fork128
a php written mysql workbench file reader to transform the database scheme to useful other schemes like Doctrine
License
mysql-workbench-schema-exporter/mysql-workbench-schema-exporter
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
MySQL Workbench Schema Exporter is a library totransform the MySQL Workbench model (*.mwb
) to useful another schemas.
It is inspired bymysql-workbench-doctrine-plugin.
Currently, MySQL Workbench Schema Exporter can export the model to various schemas using a formatter plugin:
- Doctrine 1.0YAML Schema.
- Doctrine 2.0YAML Schema,Annotation Classesor Annotation Classes withZend Framework 2Input Filter support.
- Sequelize.
- PropelXML Schema and YAML Schema.
- Sencha ExtJS3 Model and SenchaExtJS4 Model.
- Zend DbTable and Zend Rest Controller.
The actual conversion to another schema is done using an exporter. These plugins are available in subprojects:
- Doctrine1 Exporter
- Doctrine2 Exporter
- Propel1 Exporter
- Sencha ExtJS Exporter
- Sequelize Exporter
- Zend Framework 1 Exporter
- PHP 7.4+
- Composer to install the dependencies
- In your project directory issue:
composer require --dev mysql-workbench-schema-exporter/mysql-workbench-schema-exporter
You then can invoke the CLI script using
vendor/bin/mysql-workbench-schema-export
.You can directly require an exporter for your project:
composer require --dev mysql-workbench-schema-exporter/doctrine2-exporter
Themysql-workbench-schema-export
command helps export a workbench schema model directlyfrom command line. It has feature to customize export configuration before exporting.By default, it will use config fileexport.json
located in the current directory to supplythe parameter if it find it.
Command usage:
vendor/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 exporterto use.
--config=file
Read export parameters from file (in JSON format).
--save-config
Save export parameters to fileexport.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:
vendor/bin/mysql-workbench-schema-export --export=doctrine1-yaml example/data/test.mwb ./generatedvendor/bin/mysql-workbench-schema-export --zip example/data/test.mwb
MySQL Workbench Schema Exporter can be configured at runtime using methods:
- Configuration files.
- Model comment, either applied to table, column, or foreign key object.
Refers to exporter project to show detailed information.
- Doctrine1 Exporter
- Doctrine2 Exporter
- Propel1 Exporter
- Sencha ExtJS Exporter
- Sequelize Exporter
- Zend Framework 1 Exporter
{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 tableoutput can be sorted as you need such as in Propel YAML schema (obviously usefulfor exporter which results in single file output).
If you want to use MySQL Workbench Schema Exporter as a library for other project. See the included usage in theexample
folder.
About
a php written mysql workbench file reader to transform the database scheme to useful other schemes like Doctrine
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.