8000 GitHub - degami/sql-schema: Library for describe of the database schema.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

degami/sql-schema

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 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

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%
0