czproject/sql-schema

Library for describe of the database schema.

Maintainers

👁 janpecha

Package info

github.com/czproject/sql-schema

pkg:composer/czproject/sql-schema

Fund package maintenance!

Other

Statistics

Installs: 5 518

Dependents: 1

Suggesters: 0

Stars: 5

Open Issues: 0

v3.2.0 2025-06-11 08:07 UTC

Requires

  • php: 8.0 - 8.4

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

BSD-3-Clause 610fdb5f8d1a059b0ae26e9aa034ec5e411172fd

This package is auto-updated.

Last update: 2026-06-11 10:09:10 UTC


README

👁 Build Status
👁 Downloads this Month
👁 Latest Stable Version
👁 License

Library for describe of the database schema.

👁 Donate

Installation

Download a latest package or use Composer:

composer require czproject/sql-schema

CzProject\SqlSchema requires PHP 8.0 or later.

Usage

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

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

$schema->getTables();

License: New BSD License
Author: Jan Pecha, https://www.janpecha.cz/