alxarafe/resource-pdo

PDO adapter for alxarafe/resource-controller. Implements RepositoryContract, QueryContract, and TransactionContract using native PDO.

Maintainers

Package info

github.com/alxarafe/resource-pdo

pkg:composer/alxarafe/resource-pdo

Statistics

Installs: 14

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

0.1.1 2026-04-24 09:47 UTC

This package is auto-updated.

Last update: 2026-04-24 11:03:21 UTC


README

PHP Version CI Tests Static Analysis PRs Welcome

Native PDO adapter for alxarafe/resource-controller.

Implements RepositoryContract, QueryContract, and TransactionContract using pure PHP PDO, without relying on ORMs or heavy database libraries.

Ecosystem

Package Purpose Status
resource-controller Core CRUD engine + UI components ✅ Stable
resource-eloquent Eloquent ORM adapter ✅ Stable
resource-pdo Native PDO adapter ✅ Stable
resource-blade Blade template renderer adapter ✅ Stable
resource-twig Twig template renderer adapter ✅ Stable
resource-html Pure PHP/HTML template renderer adapter ✅ Stable

Installation

composer require alxarafe/resource-pdo

Usage

use Alxarafe\ResourceController\AbstractResourceController;
use Alxarafe\ResourceController\Contracts\RepositoryContract;
use Alxarafe\ResourceController\Contracts\TransactionContract;
use Alxarafe\ResourcePdo\PdoRepository;
use Alxarafe\ResourcePdo\PdoTransaction;

class UsersController extends AbstractResourceController
{
    private \PDO $pdo;

    public function __construct(\PDO $pdo) {
        $this->pdo = $pdo;
    }

    protected function getRepository(string $tabId = 'default'): RepositoryContract
    {
        return new PdoRepository($this->pdo, 'users', 'id');
    }

    protected function getTransaction(): TransactionContract
    {
        return new PdoTransaction($this->pdo);
    }
}

Features

  • Dependency-free database access using native PHP \PDO.
  • Fast, secure, and prepared statements out-of-the-box.
  • Seamless compatibility with alxarafe/resource-controller configuration array definitions.

License

GPL-3.0-or-later