PHPackages                             stdimitrov/orm - 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. stdimitrov/orm

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

stdimitrov/orm
==============

1.0.13(1y ago)022PHPPHP ^8.4

Since Apr 29Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/stdimitrov05/PHP-PDO-ORM)[ Packagist](https://packagist.org/packages/stdimitrov/orm)[ RSS](/packages/stdimitrov-orm/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)DependenciesVersions (7)Used By (0)

Custom Basic ORM for PHP (with PDO)
===================================

[](#custom-basic-orm-for-php-with-pdo)

A lightweight and flexible PHP library that simplifies database interactions by providing a basic custom ORM (Object-Relational Mapping) layer on top of PDO. Designed for developers who want simple, clean, and efficient access to their databases without heavy frameworks.

---

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

[](#requirements)

- PHP 8.4 or higher
- PDO extension enabled

---

Features
--------

[](#features)

- Automatic model generation from existing database tables
- Support InnoDB and MySQL Cluster
- Simple and intuitive CRUD operations
- Read/Write database connection support
- Automatic mapping between `snake_case` (database) and `camelCase` (PHP)
- Secure queries using prepared statements
- Lightweight and dependency-free (except PDO)
- PSR-12 compliant coding standards

---

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

[](#installation)

1. [Download a latest package](https://github.com/stdimitrov05/PHP-PDO-ORM/releases) or use [Composer](http://getcomposer.org/):

```
composer require stdimitrov/orm
```

2. Create environment file `.env` in the root directory of your project:

```
DB_HOST=localhost
DB_NAME=your_database_name
DB_USER=your_database_user
DB_PASS=your_database_password
DB_PORT_RO=3306 # this is port for read connection
DB_PORT_RW=3306 # this is port for write connection
MODEL_NAMESPACE=App\Models # Namespace for your models
```

Basic Usage
-----------

[](#basic-usage)

---

1. Create task for creating models:

```
$dir = __DIR__ . '/models'; // Directory where the models will be created
new \Stdimitrov\Orm\Tasks\CreateModels()->run($dir);
```

2. Create a repository extending current model:

```
class UsersRepository extends \App\Models\Users
{
    // Add custom methods here
}
```

Contributing
------------

[](#contributing)

---

Contributions are welcome!
Please fork the repository, create a feature branch, and submit a pull request.
Follow PSR-12 coding standards and include relevant tests.

---

License
-------

[](#license)

This project is licensed under the [MIT License](https://github.com/stdimitrov05/PHP-PDO-ORM/blob/main/LICENSE).

---

Support
-------

[](#support)

For issues, please open a GitHub Issue or contact \[\].

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance51

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community7

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

6

Last Release

374d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/624fa04679964145e1414132fca5e959ff70c67ef1dfc2c45a40564da37b158f?d=identicon)[stdimitrov05](/maintainers/stdimitrov05)

---

Top Contributors

[![stdimitrov05](https://avatars.githubusercontent.com/u/75424605?v=4)](https://github.com/stdimitrov05 "stdimitrov05 (5 commits)")

### Embed Badge

![Health badge](/badges/stdimitrov-orm/health.svg)

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

###  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)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

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

Reliese Components for Laravel Framework code generation.

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

PHPackages © 2026

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