PHPackages                             grifart/tables - 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. grifart/tables

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

grifart/tables
==============

Statically typed table gate with support for composite fields, arrays and more from PostgreSQL.

0.13.6(2mo ago)610.9k↓62%proprietaryPHPPHP ^8.4

Since Dec 5Pushed 2mo ago3 watchersCompare

[ Source](https://github.com/grifart/tables)[ Packagist](https://packagist.org/packages/grifart/tables)[ RSS](/packages/grifart-tables/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (29)Versions (36)Used By (0)

grifart/tables
==============

[](#grifarttables)

A simple library to access and manipulate database records. Built on top of [Dibi](https://github.com/dg/dibi) and **hardwired for PostgreSQL.**

This library is developed at [gitlab.grifart.cz/grifart/tables](https://gitlab.grifart.cz/grifart/tables) and distributed using [github.com/grifart/tables](https://github.com/grifart/tables). GitLab repository is automatically mirrored to GitHub for all protected branches and tags. Development branches can be found only at GitLab.

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

[](#installation)

```
composer require grifart/tables
```

Quick start
-----------

[](#quick-start)

1. **Register the tables DI extension.** Tables expect that an instance of [Dibi](https://github.com/dg/dibi) is also configured and registered in the container.

    ```
    extensions:
        tables: Grifart\Tables\DI\TablesExtension
    ```
2. **Create a database table.** You can use your favourite database migration tool.

    ```
    CREATE TABLE "article" (
      "id" uuid NOT NULL PRIMARY KEY,
      "title" varchar NOT NULL,
      "text" text NOT NULL,
      "createdAt" timestamp without time zone NOT NULL,
      "deletedAt" timestamp without time zone DEFAULT NULL,
      "published" boolean NOT NULL
    );
    ```
3. **Create a definition file for [scaffolder](https://github.com/grifart/scaffolder).** Tables expose a helper that creates all necessary class definitions for you:

    ```
