PHPackages                             ritalin/omelet - 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. ritalin/omelet

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

ritalin/omelet
==============

SQL base object mapper for php

0.3.4(10y ago)269[8 issues](https://github.com/ritalin/omelet/issues)1MITPHPPHP &gt;=5.5.0

Since May 20Pushed 10y ago1 watchersCompare

[ Source](https://github.com/ritalin/omelet)[ Packagist](https://packagist.org/packages/ritalin/omelet)[ RSS](/packages/ritalin-omelet/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (4)Versions (29)Used By (1)

Omelet - SQL base object mapper for php.
========================================

[](#omelet---sql-base-object-mapper-for-php)

This Library is inspired by Doma().

Requirements
------------

[](#requirements)

php &gt;= 5.5.x

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

[](#installation)

Omelet can be installed with [Composer](https://getcomposer.org).

Define the following requirement in your **composer.json** file:

```
{
    "require": {
        "ritalin/omelet": "*"
    }
}
```

Quick Start
-----------

[](#quick-start)

1. Define Dao (Data Access Object) interface.

    - DAO method is need to describe an annotation comment to distingish database command/query.

    ```
    use \Omelet\Annotation\Select;

    interface TodoDao {
        /**
         * @Select
         */
        function listAll();
    }
    ```
2. Prepare sql file of same name as method. sql file path depends on namespace for dao interface.

    ```
    -- listAll.sql
    select * from todo order by id
    ```
3. Instanciate **\\Omelet\\Builder\\DaoBuilderContext** .

    - At least, need to a connection string to database as configuration.

    ```
    $config = \Omelet\Builder\Configuration;
    $config->connectionString = "driver=pdo_sqlite&path=/path/to/todo.sqlite3";

    $context = new \Omelet\Builder\DaoBuilderContext($config);
    ```
4. Generate Dao concrete class.

    ```
    $context->build(Todo::class);
    ```
5. Use Dao.

    - A Dao concrete class name note that 'Impl' is suffixed to interface name by default.

    ```
    $conn = \Doctrine\DBAL\DriverManager->getConnection($context->connectionString());
    $dao = new TodoImpl($conn, $context);
    $rows = $dao->listAll();
    ```

Sample Application
------------------

[](#sample-application)

Please see [ritalin/omelet-bear-example](https://github.com/ritalin/omelet-bear-example) implemented with BEAR.Sunday () framework.

now work in progress ...

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 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 ~2 days

Total

27

Last Release

3968d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/784f7b6aed00f8db7c1dd3950a5b52d1c88fb1d5a5bd301b520084253a27aa39?d=identicon)[ritalin](/maintainers/ritalin)

---

Top Contributors

[![ritalin](https://avatars.githubusercontent.com/u/908072?v=4)](https://github.com/ritalin "ritalin (40 commits)")

---

Tags

databaseorm

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ritalin-omelet/health.svg)

```
[![Health](https://phpackages.com/badges/ritalin-omelet/health.svg)](https://phpackages.com/packages/ritalin-omelet)
```

###  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)[laravel-doctrine/migrations

Doctrine Migrations for Laravel

782.8M16](/packages/laravel-doctrine-migrations)[williarin/wordpress-interop

Interoperability library to work with WordPress database in third party apps

6610.9k2](/packages/williarin-wordpress-interop)

PHPackages © 2026

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