Download a latest package or use Composer:
composer require inlm/schema-generator-dibi
Schema Generator requires PHP 8.0 or later and Dibi 3.0 or newer.
Supported databases:
- MySQL
It generates schema from existing database.
$connection = new Dibi\Connection(...);
$ignoredTables = ['migrations'];
$extractor = new Inlm\SchemaGenerator\DibiBridge\DibiExtractor($connection, $ignoredTables);It loads schema from existing database.
$connection = new Dibi\Connection(...);
$ignoredTables = ['migrations'];
$extractor = new Inlm\SchemaGenerator\DibiBridge\DibiAdapter($connection, $ignoredTables);Note: saving of schema is not supported, use DibiDumper.
DibiDumper executes SQL queries directly in database.
$connection = new Dibi\Connection(...);
$dumper = new Inlm\SchemaGenerator\DibiBridge\DibiDumper($connection);
$dumper->setHeader(array(
'SET foreign_key_checks = 1;',
));If you need generate ... AFTER column in ALTER TABLE statements, call:
$dumper->enablePositionChanges();License: New BSD License
Author: Jan Pecha, https://www.janpecha.cz/