{"id":18929439,"url":"https://github.com/thecodingmachine/tdbm-fluid-schema-builder","last_synced_at":"2025-04-15T15:30:58.038Z","repository":{"id":55153476,"uuid":"174978588","full_name":"thecodingmachine/tdbm-fluid-schema-builder","owner":"thecodingmachine","description":"Build and modify your database schema used by TDBM using a fluid syntax.","archived":false,"fork":false,"pushed_at":"2024-01-28T13:40:41.000Z","size":51,"stargazers_count":0,"open_issues_count":1,"forks_count":3,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-09T20:15:38.692Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thecodingmachine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-11T10:37:39.000Z","updated_at":"2024-01-28T13:39:38.000Z","dependencies_parsed_at":"2024-11-08T11:48:33.176Z","dependency_job_id":null,"html_url":"https://github.com/thecodingmachine/tdbm-fluid-schema-builder","commit_stats":{"total_commits":33,"total_committers":2,"mean_commits":16.5,"dds":"0.12121212121212122","last_synced_commit":"1aacb60bb1eae49a4c2726222e391b78bc16d927"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Ftdbm-fluid-schema-builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Ftdbm-fluid-schema-builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Ftdbm-fluid-schema-builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Ftdbm-fluid-schema-builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thecodingmachine","download_url":"https://codeload.github.com/thecodingmachine/tdbm-fluid-schema-builder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249097819,"owners_count":21212359,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T11:32:46.251Z","updated_at":"2025-04-15T15:30:57.795Z","avatar_url":"https://github.com/thecodingmachine.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Latest Stable Version](https://poser.pugx.org/thecodingmachine/tdbm-fluid-schema-builder/v/stable)](https://packagist.org/packages/thecodingmachine/tdbm-fluid-schema-builder)\n[![Total Downloads](https://poser.pugx.org/thecodingmachine/tdbm-fluid-schema-builder/downloads)](https://packagist.org/packages/thecodingmachine/tdbm-fluid-schema-builder)\n[![Latest Unstable Version](https://poser.pugx.org/thecodingmachine/tdbm-fluid-schema-builder/v/unstable)](https://packagist.org/packages/thecodingmachine/tdbm-fluid-schema-builder)\n[![License](https://poser.pugx.org/thecodingmachine/tdbm-fluid-schema-builder/license)](https://packagist.org/packages/thecodingmachine/tdbm-fluid-schema-builder)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/thecodingmachine/tdbm-fluid-schema-builder/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/thecodingmachine/tdbm-fluid-schema-builder/?branch=master)\n[![Build Status](https://travis-ci.org/thecodingmachine/tdbm-fluid-schema-builder.svg?branch=master)](https://travis-ci.org/thecodingmachine/tdbm-fluid-schema-builder)\n[![Coverage Status](https://coveralls.io/repos/thecodingmachine/tdbm-fluid-schema-builder/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/thecodingmachine/tdbm-fluid-schema-builder?branch=master)\n\n# Fluid schema builder for TDBM\n\nBuild 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.\nThis project allows you to tailor your database schema to TDBM (it will allow you to easily add annotations that TDBM can read).\n\nIt is a super-set of [dbal-fluid-schema-builder](https://github.com/thecodingmachine/dbal-fluid-schema-builder/).\n\nIf you don't know *dbal-fluid-schema-builder*, [check the documentation first](https://github.com/thecodingmachine/dbal-fluid-schema-builder/).\n\n\n## Why?\n\nTDBM can read a number of annotations in the schema comments (see [TDBM annotations documentation](https://thecodingmachine.github.io/tdbm/doc/annotations.html)).\n\nThis library allows to write these annotations using functions added to the \"dbal-fluid-schema-builder\".\n\n## What's added?\n\n```php\n$db = new TdbmFluidSchema($schema);\n\n// Customize the name of the Bean class\n$posts = $db-\u003etable('posts')-\u003ecustomBeanName('Article');\n\n// You can pass a new 'v1' or 'v4' parameter to uuid().\n// This will generate a @UUID TDBM annotation that will help TDBM autogenerate the UUID \n$posts = $db-\u003etable('posts')-\u003euuid('v4');\n\n// Customize the visibility of a column\n$db-\u003etable('posts')\n   -\u003ecolumn('user_id')-\u003ereferences('users')\n                      -\u003eprotectedGetter() // The Post.getUser() method is protected\n                      -\u003eprotectedSetter() // The Post.setUser() method is protected\n                      -\u003eprotectedOneToMany() // The User.getPosts() method is protected\n\n// Customize implemented interfaces\n$db-\u003etable('posts')\n   -\u003eimplementsInterface('App\\\\PostInterface')  // The generated bean will implement interface App\\\\PostInterface\n   -\u003eimplementsInterfaceOnDao('App\\\\PostDaoInterface'); // The generated DAO will implement interface App\\\\PostDaoInterface\n\n// The \"posts\" table will generate a GraphQL type (i.e. the bean will be annotated with the GraphQLite @Type annotation).\n$posts = $db-\u003etable('posts')-\u003egraphqlType();\n\n// You can pass a new 'v1' or 'v4' parameter to uuid().\n// This will generate a @UUID TDBM annotation that will help TDBM autogenerate the UUID \n$posts = $db-\u003etable('posts')-\u003ecolumn('title')-\u003estring(50)-\u003egraphqlField() // The column is a GraphQL field\n            -\u003efieldName('the_title') // Let's set the name of the field to a different value \n            -\u003elogged() // The user must be logged to view the field\n            -\u003eright('CAN_EDIT') // The user must have the 'CAN_EDIT' right to view the field\n            -\u003efailWith(null) // If the user is not logged or has no right, let's serve 'null'\n            -\u003eendGraphql();\n\n// You can pass instructions on how JSON serialization occurs.\n// This will generate a set of JSONxxx annotations.\n$nodes = $db-\u003etable('nodes')\n    -\u003ecolumn('id')-\u003einteger()-\u003eprimaryKey()-\u003eautoIncrement()-\u003ejsonSerialize()-\u003eignore()\n    -\u003ecolumn('alias_id')-\u003ereferences('nodes')-\u003enull()-\u003ejsonSerialize()-\u003erecursive()\n    -\u003ecolumn('parent_id')-\u003ereferences('nodes')-\u003enull()-\u003ejsonSerialize()-\u003einclude()\n    -\u003ecolumn('root_id')-\u003ereferences('nodes')-\u003enull()-\u003ejsonSerialize()-\u003eignore()\n    -\u003ecolumn('owner_id')-\u003ereferences('authors')-\u003enull()-\u003ejsonSerialize()-\u003eformatUsingProperty('name')-\u003einclude()\n    -\u003ecolumn('owner_country')-\u003ereferences('authors')-\u003enull()-\u003ejsonSerialize()-\u003eformatUsingMethod('getCountryName')-\u003einclude()\n    -\u003ecolumn('name')-\u003estring()-\u003ejsonSerialize()-\u003ekey('basename')\n    -\u003ecolumn('size')-\u003einteger()-\u003enotNull()-\u003edefault(0)-\u003ejsonSerialize()-\u003enumericFormat(null, null, null, ' o')\n    -\u003ecolumn('weight')-\u003efloat()-\u003enull()-\u003ejsonSerialize()-\u003enumericFormat(2, ',', '.', 'g')\n    -\u003ecolumn('created_at')-\u003edate()-\u003enull()-\u003ejsonSerialize()-\u003edatetimeFormat(\"Y-m-d\")\n    -\u003ecolumn('another_parent')-\u003ereferences('nodes')-\u003ecomment('@JsonCollection(\"entries\") @JsonFormat(property=\"entry\")');\n\n$db-\u003ejunctionTable('posts', 'users')-\u003egraphqlField(); // Expose the many-to-many relationship as a GraphQL field.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodingmachine%2Ftdbm-fluid-schema-builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthecodingmachine%2Ftdbm-fluid-schema-builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodingmachine%2Ftdbm-fluid-schema-builder/lists"}