A partitioned model ORM. Handles DAO and DTO objects
Go to file
Funky Waddle 6252dd6107
Some checks are pending
CI / test (8.2) (push) Waiting to run
CI / test (8.3) (push) Waiting to run
Get Production ready
2026-01-06 13:01:31 -06:00
.github/workflows code standards tightening 2025-12-15 13:29:43 -06:00
bin Cache and some other things 2026-01-06 10:56:40 -06:00
examples Docs/examples/CI polish 2025-12-11 07:37:40 -06:00
src Get Production ready 2026-01-06 13:01:31 -06:00
tests Cache and some other things 2026-01-06 10:56:40 -06:00
.gitignore Cache and some other things 2026-01-06 10:56:40 -06:00
.phpunit.result.cache update phpunit cache 2025-12-15 16:42:04 -06:00
CHANGELOG.md Get Production ready 2026-01-06 13:01:31 -06:00
composer.json Cache and some other things 2026-01-06 10:56:40 -06:00
composer.lock Cache and some other things 2026-01-06 10:56:40 -06:00
LICENSE Initial commit 2025-12-09 22:00:02 +00:00
MILESTONES.md Get Production ready 2026-01-06 13:01:31 -06:00
phpunit.xml.dist fix testing 2025-12-11 09:19:41 -06:00
README.md Cache and some other things 2026-01-06 10:56:40 -06:00
SPECS.md Cache and some other things 2026-01-06 10:56:40 -06:00

Pairity

A partitionedmodel PHP ORM (DTO/DAO) with Query Builder, relations, raw SQL helpers, and a portable migrations + schema builder.

CI Packagist

Installation

  • Requirements: PHP >= 8.2, PDO extension for your database(s)
  • Install via Composer:
composer require getphred/pairity

After install, you can use the CLI at vendor/bin/pairity.

Testing

This project uses PHPUnit 10. The default test suite excludes MongoDB integration tests by default for portability.

  • Install dev dependencies:
composer install
  • Run the default suite (SQLite + unit tests; Mongo tests excluded by default):
vendor/bin/phpunit
  • Run MongoDB integration tests (requires ext-mongodb >= 2.1 and a reachable server):
MONGO_HOST=127.0.0.1 MONGO_PORT=27017 vendor/bin/phpunit --group mongo-integration

Quick Start

Minimal example with SQLite and a simple users DAO/DTO.

use Pairity\Database\ConnectionManager;
use Pairity\Model\AbstractDto;
use Pairity\Model\AbstractDao;

// 1) Connect
$conn = ConnectionManager::make([
    'driver' => 'sqlite',
    'path'   => __DIR__ . '/db.sqlite',
]);

// 2) Define DTO + DAO
class UserDto extends AbstractDto {}
class UserDao extends AbstractDao {
    public function getTable(): string { return 'users'; }
    protected function dtoClass(): string { return UserDto::class; }
}

// 3) CRUD
$dao = new UserDao($conn);
$created = $dao->insert(['email' => 'a@b.com', 'name' => 'Alice']);
$user = $dao->findById($created->id);

For more detailed usage and technical specifications, see SPECS.md.

Documentation

Contributing

This is an early foundation. Contributions, discussions, and design proposals are welcome. Please open an issue to coordinate larger features.

License

MIT