inlm/schema-generator-dibi

Dibi bridge for inlm/schema-generator

Fund package maintenance!
Other

v1.0.1 2023-07-28 07:41 UTC

This package is auto-updated.

Last update: 2024-04-10 06:52:51 UTC


README

Build Status Downloads this Month Latest Stable Version License

Donate

Installation

Download a latest package or use Composer:

composer require inlm/schema-generator-dibi

Schema Generator requires PHP 5.6.0 or later and Dibi 3.0 or newer.

Documentation

Supported databases:

  • MySQL

DibiExtractor

It generates schema from existing database.

$connection = new Dibi\Connection(...);
$ignoredTables = ['migrations'];
$extractor = new Inlm\SchemaGenerator\DibiBridge\DibiExtractor($connection, $ignoredTables);

DibiAdapter

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

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/