PHPackages                             wpjscc/schema-builder - 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. wpjscc/schema-builder

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

wpjscc/schema-builder
=====================

Cycle ORM Schema Builder

2.x-dev(6mo ago)0182MITPHPPHP &gt;=8.0

Since Nov 7Pushed 6mo agoCompare

[ Source](https://github.com/wpjscc/schema-builder)[ Packagist](https://packagist.org/packages/wpjscc/schema-builder)[ GitHub Sponsors](https://github.com/sponsors/cycle)[ RSS](/packages/wpjscc-schema-builder/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelogDependencies (8)Versions (1)Used By (2)

Cycle ORM - Schema Builder
==========================

[](#cycle-orm---schema-builder)

[![Latest Stable Version](https://camo.githubusercontent.com/83cc614a1ba63c26bf8e3e98781f302779981ea624237c405c01aafdd19b7065/68747470733a2f2f706f7365722e707567782e6f72672f6379636c652f736368656d612d6275696c6465722f76657273696f6e)](https://packagist.org/packages/cycle/schema-builder)[![Build Status](https://github.com/cycle/schema-builder/workflows/build/badge.svg)](https://github.com/cycle/schema-builder/actions)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/5ae51450ef0a62ffe41ac052815286ad39c9c3800d92062ce92add4297c96f85/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6379636c652f736368656d612d6275696c6465722f6261646765732f7175616c6974792d73636f72652e706e673f623d322e78)](https://scrutinizer-ci.com/g/cycle/schema-builder/?branch=2.x)[![Codecov](https://camo.githubusercontent.com/9252187786facac4a204e7452cf42c87225f38838477b8f26ea986a10358050f/68747470733a2f2f636f6465636f762e696f2f67682f6379636c652f736368656d612d6275696c6465722f67726170682f62616467652e737667)](https://codecov.io/gh/cycle/schema-builder)

Schema Builder package provides a convenient way to configure your ORM and Database schema via [annotations (attributes)](https://github.com/cycle/annotated) or custom generators.

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

[](#installation)

```
composer require cycle/schema-builder
```

Configuration
-------------

[](#configuration)

```
use Cycle\Migrations;
use Cycle\Database;
use Cycle\Database\Config;

$dbal = new Database\DatabaseManager(new Config\DatabaseConfig([
    'default' => 'default',
    'databases' => [
        'default' => [
            'connection' => 'sqlite'
        ]
    ],
    'connections' => [
        'sqlite' => new Config\SQLiteDriverConfig(
            connection: new Config\SQLite\MemoryConnectionConfig(),
            queryCache: true,
        ),
    ]
]));

$registry = new \Cycle\Schema\Registry($dbal);
```

We can now register our first entity, add its columns and link to a specific table:

```
use Cycle\Schema\Definition;

$entity = new Definition\Entity();

$entity
    ->setRole('user')
    ->setClass(User::class);

// add fields
$entity->getFields()
    ->set('id', (new Definition\Field())->setType('primary')->setColumn('id')->setPrimary(true))
    ->set('name', (new Definition\Field())->setType('string(32)')->setColumn('user_name'));

// register entity
$r->register($entity);

// associate table
$r->linkTable($entity, 'default', 'users');
```

You can generate ORM schema immediately using `Cycle\Schema\Compiler`:

```
use Cycle\Schema\Compiler;
$schema = (new Compiler())->compile($r);

$orm = $orm->with(schema: new \Cycle\ORM\Schema($schema));
```

You can find more information about Schema builder package [here](https://cycle-orm.dev/docs/schema-dynamic-schema#using-schema-builder).

License:
--------

[](#license)

The MIT License (MIT). Please see [`LICENSE`](./LICENSE) for more information. Maintained by [Spiral Scout](https://spiralscout.com).

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance67

Regular maintenance activity

Popularity8

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity24

Early-stage or recently created project

 Bus Factor1

Top contributor holds 55.2% 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

Unknown

Total

1

Last Release

193d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/76907477?v=4)[wpjscc](/maintainers/wpjscc)[@wpjscc](https://github.com/wpjscc)

---

Top Contributors

[![wolfy-j](https://avatars.githubusercontent.com/u/796136?v=4)](https://github.com/wolfy-j "wolfy-j (175 commits)")[![roxblnfk](https://avatars.githubusercontent.com/u/4152481?v=4)](https://github.com/roxblnfk "roxblnfk (54 commits)")[![msmakouz](https://avatars.githubusercontent.com/u/67324318?v=4)](https://github.com/msmakouz "msmakouz (35 commits)")[![butschster](https://avatars.githubusercontent.com/u/773481?v=4)](https://github.com/butschster "butschster (13 commits)")[![puzzledpolymath](https://avatars.githubusercontent.com/u/162779269?v=4)](https://github.com/puzzledpolymath "puzzledpolymath (9 commits)")[![gam6itko](https://avatars.githubusercontent.com/u/3841197?v=4)](https://github.com/gam6itko "gam6itko (7 commits)")[![rauanmayemir](https://avatars.githubusercontent.com/u/9691?v=4)](https://github.com/rauanmayemir "rauanmayemir (5 commits)")[![thenotsoft](https://avatars.githubusercontent.com/u/44147615?v=4)](https://github.com/thenotsoft "thenotsoft (4 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (4 commits)")[![SerafimArts](https://avatars.githubusercontent.com/u/2461257?v=4)](https://github.com/SerafimArts "SerafimArts (3 commits)")[![EvgenyBarinov](https://avatars.githubusercontent.com/u/65846823?v=4)](https://github.com/EvgenyBarinov "EvgenyBarinov (2 commits)")[![wpjscc](https://avatars.githubusercontent.com/u/76907477?v=4)](https://github.com/wpjscc "wpjscc (1 commits)")[![guilhermeaiolfi](https://avatars.githubusercontent.com/u/254360?v=4)](https://github.com/guilhermeaiolfi "guilhermeaiolfi (1 commits)")[![jstark518](https://avatars.githubusercontent.com/u/1571324?v=4)](https://github.com/jstark518 "jstark518 (1 commits)")[![laxity7](https://avatars.githubusercontent.com/u/6792144?v=4)](https://github.com/laxity7 "laxity7 (1 commits)")[![mrakolice](https://avatars.githubusercontent.com/u/4227668?v=4)](https://github.com/mrakolice "mrakolice (1 commits)")[![alexndr-novikov](https://avatars.githubusercontent.com/u/7372962?v=4)](https://github.com/alexndr-novikov "alexndr-novikov (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/wpjscc-schema-builder/health.svg)

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

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90440.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)[wildside/userstamps

Laravel Userstamps provides an Eloquent trait which automatically maintains `created\_by` and `updated\_by` columns on your model, populated by the currently authenticated user in your application.

7511.7M13](/packages/wildside-userstamps)

PHPackages © 2026

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