PHPackages                             czproject/sql-schema - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. czproject/sql-schema

ActiveLibrary[Database &amp; ORM](/categories/database)

czproject/sql-schema
====================

Library for describe of the database schema.

v3.2.0(1y ago)55.5k11BSD-3-ClausePHPPHP 8.0 - 8.4CI passing

Since Jun 28Pushed 1y ago1 watchersCompare

[ Source](https://github.com/czproject/sql-schema)[ Packagist](https://packagist.org/packages/czproject/sql-schema)[ Fund](https://www.janpecha.cz/donate/)[ RSS](/packages/czproject-sql-schema/feed)WikiDiscussions master Synced today

READMEChangelog (8)Dependencies (1)Versions (14)Used By (1)

CzProject\\SqlSchema
====================

[](#czprojectsqlschema)

[![Build Status](https://github.com/czproject/sql-schema/workflows/Build/badge.svg)](https://github.com/czproject/sql-schema/actions)[![Downloads this Month](https://camo.githubusercontent.com/ed018e19a73707ae1fbefd88df5bf5a22dbde348912d64d9c82a7450f3867317/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f637a70726f6a6563742f73716c2d736368656d612e737667)](https://packagist.org/packages/czproject/sql-schema)[![Latest Stable Version](https://camo.githubusercontent.com/42d8fc82414cf6f1dbd23f71eabc2f8b5722bad11579c85766ccde09c0c627d7/68747470733a2f2f706f7365722e707567782e6f72672f637a70726f6a6563742f73716c2d736368656d612f762f737461626c65)](https://github.com/czproject/sql-schema/releases)[![License](https://camo.githubusercontent.com/fa7d5fcf2c84b580327af52da95dd751703af65f079dc3c5a0081beac0789718/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4e65772532304253442d626c75652e737667)](https://github.com/czproject/sql-schema/blob/master/license.md)

Library for describe of the database schema.

[![Donate](https://camo.githubusercontent.com/101b981194f1dafbf9c42e19c3034fe2d724e75be972cef0f4477074997834db/68747470733a2f2f6275796d65636f666665652e696e746d2e6f72672f696d672f646f6e6174652d62616e6e65722e76312e737667)](https://www.janpecha.cz/donate/)

Installation
------------

[](#installation)

[Download a latest package](https://github.com/czproject/sql-schema/releases) or use [Composer](http://getcomposer.org/):

```
composer require czproject/sql-schema

```

CzProject\\SqlSchema requires PHP 8.0 or later.

Usage
-----

[](#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](license.md)
Author: Jan Pecha,

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance48

Moderate activity, may be stable

Popularity25

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity88

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~242 days

Recently: every ~171 days

Total

13

Last Release

388d ago

Major Versions

v1.0.1 → v2.0.02018-04-24

v2.1.0 → v3.0.02021-01-06

PHP version history (3 changes)v1.0.0PHP &gt;=5.3.0

v3.0.0PHP &gt;=5.6.0

v3.2.0PHP 8.0 - 8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/5c980b1511b4a0350442dc23d89c99d4d9a2411b7e765d52c133ccacf616968b?d=identicon)[janpecha](/maintainers/janpecha)

---

Top Contributors

[![janpecha](https://avatars.githubusercontent.com/u/637719?v=4)](https://github.com/janpecha "janpecha (44 commits)")

---

Tags

database-schemaphpsql-schema

### Embed Badge

![Health badge](/badges/czproject-sql-schema/health.svg)

```
[![Health](https://phpackages.com/badges/czproject-sql-schema/health.svg)](https://phpackages.com/packages/czproject-sql-schema)
```

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k117.2M118](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[pgvector/pgvector

pgvector support for PHP

198741.5k12](/packages/pgvector-pgvector)[jfelder/oracledb

Oracle DB driver for Laravel

11518.4k](/packages/jfelder-oracledb)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
