PHPackages                             thecodingmachine/tdbm-fluid-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. thecodingmachine/tdbm-fluid-schema-builder

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

thecodingmachine/tdbm-fluid-schema-builder
==========================================

Build and modify your database schema used by TDBM using a fluid syntax.

v2.0.0(2y ago)0108.2k↓12.2%3[1 issues](https://github.com/thecodingmachine/tdbm-fluid-schema-builder/issues)3MITPHPPHP ^7.4 || ^8.0

Since Oct 21Pushed 2y ago6 watchersCompare

[ Source](https://github.com/thecodingmachine/tdbm-fluid-schema-builder)[ Packagist](https://packagist.org/packages/thecodingmachine/tdbm-fluid-schema-builder)[ RSS](/packages/thecodingmachine-tdbm-fluid-schema-builder/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (4)Versions (5)Used By (3)

[![Latest Stable Version](https://camo.githubusercontent.com/e4d618e05db262c10295662d1cb40e0eb9a2e7c28f1e63afc4a8f15cd2c404dd/68747470733a2f2f706f7365722e707567782e6f72672f746865636f64696e676d616368696e652f7464626d2d666c7569642d736368656d612d6275696c6465722f762f737461626c65)](https://packagist.org/packages/thecodingmachine/tdbm-fluid-schema-builder)[![Total Downloads](https://camo.githubusercontent.com/24061eefcf94a6897613ca267476966cf62f390fc7b50c9af715f646d8524491/68747470733a2f2f706f7365722e707567782e6f72672f746865636f64696e676d616368696e652f7464626d2d666c7569642d736368656d612d6275696c6465722f646f776e6c6f616473)](https://packagist.org/packages/thecodingmachine/tdbm-fluid-schema-builder)[![Latest Unstable Version](https://camo.githubusercontent.com/b40fa39ae4664ef0b94f1938fd75b5fa04421b47eb65dc14d97e3dd9114f8f2f/68747470733a2f2f706f7365722e707567782e6f72672f746865636f64696e676d616368696e652f7464626d2d666c7569642d736368656d612d6275696c6465722f762f756e737461626c65)](https://packagist.org/packages/thecodingmachine/tdbm-fluid-schema-builder)[![License](https://camo.githubusercontent.com/c0083a85703781af1a1d460d85868a768050abfe7d944645aa8ceac5d2872d67/68747470733a2f2f706f7365722e707567782e6f72672f746865636f64696e676d616368696e652f7464626d2d666c7569642d736368656d612d6275696c6465722f6c6963656e7365)](https://packagist.org/packages/thecodingmachine/tdbm-fluid-schema-builder)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/5d292eabf4d8a9e4c4d202b4b0edacdcdc20b20ec09bf305866162f84488c2ed/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f746865636f64696e676d616368696e652f7464626d2d666c7569642d736368656d612d6275696c6465722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/thecodingmachine/tdbm-fluid-schema-builder/?branch=master)[![Build Status](https://camo.githubusercontent.com/67f5097202e34345ca456510054a2ae2374f86bfd348e2e0844f6829b76fb40e/68747470733a2f2f7472617669732d63692e6f72672f746865636f64696e676d616368696e652f7464626d2d666c7569642d736368656d612d6275696c6465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/thecodingmachine/tdbm-fluid-schema-builder)[![Coverage Status](https://camo.githubusercontent.com/92e9b8009e6c3ac32313f7f4cae6fbc557d762586b61fdc0f7bb3c3380878f7d/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f746865636f64696e676d616368696e652f7464626d2d666c7569642d736368656d612d6275696c6465722f62616467652e7376673f6272616e63683d6d617374657226736572766963653d676974687562)](https://coveralls.io/github/thecodingmachine/tdbm-fluid-schema-builder?branch=master)

Fluid schema builder for TDBM
=============================

[](#fluid-schema-builder-for-tdbm)

Build and modify your database schema using [DBAL](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/schema-representation.html) and a fluid syntax. This project allows you to tailor your database schema to TDBM (it will allow you to easily add annotations that TDBM can read).

It is a super-set of [dbal-fluid-schema-builder](https://github.com/thecodingmachine/dbal-fluid-schema-builder/).

If you don't know *dbal-fluid-schema-builder*, [check the documentation first](https://github.com/thecodingmachine/dbal-fluid-schema-builder/).

Why?
----

[](#why)

TDBM can read a number of annotations in the schema comments (see [TDBM annotations documentation](https://thecodingmachine.github.io/tdbm/doc/annotations.html)).

This library allows to write these annotations using functions added to the "dbal-fluid-schema-builder".

What's added?
-------------

[](#whats-added)

```
$db = new TdbmFluidSchema($schema);

// Customize the name of the Bean class
$posts = $db->table('posts')->customBeanName('Article');

// You can pass a new 'v1' or 'v4' parameter to uuid().
// This will generate a @UUID TDBM annotation that will help TDBM autogenerate the UUID
$posts = $db->table('posts')->uuid('v4');

// Customize the visibility of a column
$db->table('posts')
   ->column('user_id')->references('users')
                      ->protectedGetter() // The Post.getUser() method is protected
                      ->protectedSetter() // The Post.setUser() method is protected
                      ->protectedOneToMany() // The User.getPosts() method is protected

// Customize implemented interfaces
$db->table('posts')
   ->implementsInterface('App\\PostInterface')  // The generated bean will implement interface App\\PostInterface
   ->implementsInterfaceOnDao('App\\PostDaoInterface'); // The generated DAO will implement interface App\\PostDaoInterface

// The "posts" table will generate a GraphQL type (i.e. the bean will be annotated with the GraphQLite @Type annotation).
$posts = $db->table('posts')->graphqlType();

// You can pass a new 'v1' or 'v4' parameter to uuid().
// This will generate a @UUID TDBM annotation that will help TDBM autogenerate the UUID
$posts = $db->table('posts')->column('title')->string(50)->graphqlField() // The column is a GraphQL field
            ->fieldName('the_title') // Let's set the name of the field to a different value
            ->logged() // The user must be logged to view the field
            ->right('CAN_EDIT') // The user must have the 'CAN_EDIT' right to view the field
            ->failWith(null) // If the user is not logged or has no right, let's serve 'null'
            ->endGraphql();

// You can pass instructions on how JSON serialization occurs.
// This will generate a set of JSONxxx annotations.
$nodes = $db->table('nodes')
    ->column('id')->integer()->primaryKey()->autoIncrement()->jsonSerialize()->ignore()
    ->column('alias_id')->references('nodes')->null()->jsonSerialize()->recursive()
    ->column('parent_id')->references('nodes')->null()->jsonSerialize()->include()
    ->column('root_id')->references('nodes')->null()->jsonSerialize()->ignore()
    ->column('owner_id')->references('authors')->null()->jsonSerialize()->formatUsingProperty('name')->include()
    ->column('owner_country')->references('authors')->null()->jsonSerialize()->formatUsingMethod('getCountryName')->include()
    ->column('name')->string()->jsonSerialize()->key('basename')
    ->column('size')->integer()->notNull()->default(0)->jsonSerialize()->numericFormat(null, null, null, ' o')
    ->column('weight')->float()->null()->jsonSerialize()->numericFormat(2, ',', '.', 'g')
    ->column('created_at')->date()->null()->jsonSerialize()->datetimeFormat("Y-m-d")
    ->column('another_parent')->references('nodes')->comment('@JsonCollection("entries") @JsonFormat(property="entry")');

$db->junctionTable('posts', 'users')->graphqlField(); // Expose the many-to-many relationship as a GraphQL field.
```

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 87.5% 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 ~520 days

Total

4

Last Release

841d ago

Major Versions

v1.1.1 → v2.0.02024-01-28

PHP version history (2 changes)v1.0.0PHP &gt;=7.1

v2.0.0PHP ^7.4 || ^8.0

### Community

Maintainers

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

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

---

Top Contributors

[![moufmouf](https://avatars.githubusercontent.com/u/1290952?v=4)](https://github.com/moufmouf "moufmouf (49 commits)")[![dsavina](https://avatars.githubusercontent.com/u/22031211?v=4)](https://github.com/dsavina "dsavina (4 commits)")[![aszenz](https://avatars.githubusercontent.com/u/25319264?v=4)](https://github.com/aszenz "aszenz (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/thecodingmachine-tdbm-fluid-schema-builder/health.svg)

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

###  Alternatives

[scienta/doctrine-json-functions

A set of extensions to Doctrine that add support for json query functions.

58723.9M36](/packages/scienta-doctrine-json-functions)[martin-georgiev/postgresql-for-doctrine

Extends Doctrine with native PostgreSQL support for arrays, JSONB, ranges, PostGIS geometries, text search, ltree, uuid, and 100+ PostgreSQL-specific functions.

4485.3M4](/packages/martin-georgiev-postgresql-for-doctrine)[damienharper/auditor-bundle

Integrate auditor library in your Symfony projects.

4542.8M](/packages/damienharper-auditor-bundle)[sonata-project/entity-audit-bundle

Audit for Doctrine Entities

644989.8k1](/packages/sonata-project-entity-audit-bundle)[overtrue/laravel-versionable

Make Laravel model versionable.

585308.0k5](/packages/overtrue-laravel-versionable)[worksome/foggy

Foggy is a tool for making database dumps with some data removed/changed.

26571.7k1](/packages/worksome-foggy)

PHPackages © 2026

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