PHPackages                             power-modules/persistence - 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. [Framework](/categories/framework)
4. /
5. power-modules/persistence

ActiveLibrary[Framework](/categories/framework)

power-modules/persistence
=========================

Persistence module for Power Modules framework.

0.4.0(1mo ago)050↓50%MITPHPPHP ^8.4CI passing

Since Dec 3Pushed 1mo agoCompare

[ Source](https://github.com/power-modules/persistence)[ Packagist](https://packagist.org/packages/power-modules/persistence)[ RSS](/packages/power-modules-persistence/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (14)Versions (17)Used By (0)

Modular Persistence
===================

[](#modular-persistence)

[![CI](https://github.com/power-modules/persistence/actions/workflows/php.yml/badge.svg)](https://github.com/power-modules/persistence/actions/workflows/php.yml)[![Packagist Version](https://camo.githubusercontent.com/e0c42c2fd8375cecb0172dc7fdcd5d775534442495201ad0d211949de461d014/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f706f7765722d6d6f64756c65732f70657273697374656e6365)](https://packagist.org/packages/power-modules/persistence)[![PHP Version](https://camo.githubusercontent.com/74b2ff084d319e08f225fcde5f5da9d679fa31102ba64cacf8e4a4faa32a4602/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f706f7765722d6d6f64756c65732f70657273697374656e6365)](https://packagist.org/packages/power-modules/persistence)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](LICENSE)[![PHPStan](https://camo.githubusercontent.com/1b02b2f6c2946c9b9ad2e14b1c79c5932fdcef4ea31b4d6e79d54af7d7e7a2a7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c253230382d626c7565)](#)

A **type-safe, multi-tenant persistence layer** for PHP 8.4+ built on the Modular Framework. It provides a robust Repository pattern implementation with native support for Postgres schemas and strict type safety.

> **💡 Robust:** Built for complex applications requiring strict data integrity, multi-tenancy, and clear separation of concerns.

✨ Why Modular Persistence?
--------------------------

[](#-why-modular-persistence)

- **🔒 Type-Safe Schemas**: Define database schemas using PHP Enums
- **🏢 Multi-Tenancy Native**: Built-in support for dynamic Postgres schemas (namespaces)
- **📦 Repository Pattern**: Generic CRUD repositories with decoupled SQL generation
- **🔄 Explicit Hydration**: Full control over object-relational mapping without magic
- **🛠️ Scaffolding**: CLI commands to generate your entire persistence layer
- **⚡ Performance**: Lightweight wrapper around PDO with optimized query generation

🚀 Installation
--------------

[](#-installation)

```
composer require power-modules/persistence
```

⚙️ Configuration
----------------

[](#️-configuration)

Register the module in your `ModularAppBuilder` and provide configuration in `config/modular_persistence.php`:

```
// config/modular_persistence.php
