Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Degami\SqlSchema

Library for describe of the database schema.

forked from : https://github.com/czproject/sql-schema

Installation

composer require degami/sql-schema

Degami\SqlSchema requires PHP 7.2 or later.

Usage

use Degami\SqlSchema\Index;
$schema = new Degami\SqlSchema\Schema;

$table = $schema->addTable('book');
$table->addColumn('id', 'INT', NULL, array('UNSIGNED'));
      ->addColumn('name', 'VARCHAR', array(200));
      ->addColumn('author_id', 'INT', NULL, array('UNSIGNED'));
      ->addIndex(NULL, 'id', Index::TYPE_PRIMARY);
      ->addIndex('name_author_id', array('name', 'author_id'), Index::TYPE_UNIQUE);

foreach( $schema->getTables() as $table ) {
    echo $table->showCreate()."\n";
}

License: New BSD License

About

Library for describe of the database schema.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages