PHPackages                             respect/data - 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. respect/data

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

respect/data
============

Persistence simplified

0.2.2(11y ago)1521.8k↑40%3[1 PRs](https://github.com/Respect/Data/pulls)1BSD StylePHPPHP &gt;=5.3.0CI passing

Since Dec 17Pushed 6d ago7 watchersCompare

[ Source](https://github.com/Respect/Data)[ Packagist](https://packagist.org/packages/respect/data)[ Docs](http://respect.li/)[ RSS](/packages/respect-data/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (1)Versions (6)Used By (1)

Respect\\Data
=============

[](#respectdata)

[![Latest Version](https://camo.githubusercontent.com/e9e6b7a1d7e6266ec9124efdb30f1a804d1bcad0e665ab8396d21da838f78c29/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726573706563742f646174612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/respect/data)[![Total Downloads](https://camo.githubusercontent.com/0e5c973e56820db0c39f6bb87e8f00a23e93ce4a70f2993f63ac2da75b1e67ae/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f726573706563742f646174612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/respect/data)[![License](https://camo.githubusercontent.com/bd58ccadcf8ec42214b0615eb1330f3213b2ca9a1aaabdd1c4271e506b8fb15a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f726573706563742f646174612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/respect/data)

Respect\\Data allows you to use multiple, cooperative database mapping with a single solid API. You can even mix out MySQL and MongoDB databases in a single model.

**This project is a work in progress**

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

[](#installation)

The package is available on [Packagist](https://packagist.org/packages/respect/data). You can install it using [Composer](http://getcomposer.org).

```
composer require respect/data
```

PSR-0 and PSR-2 compatible.

Collections
-----------

[](#collections)

The main component for Respect\\Data are Collections. They define how data is grouped in your application.

In the example below, we're declaring two collections for dealing with a news portal:

```
$articles = Collection::article();
$authors = Collection::article()->author();
```

Backends
--------

[](#backends)

Currently, Respect\\Data has two planned backend implementations: Respect\\Relational for relational databases like MySQL and SQLite and Respect\\Structural for MongoDB databases. These are different mappers that use the Respect\\Data model.

Below is a sample of how to retrieve all authors from the author 5:

```
$mapper->article->author[5]->fetchAll();
```

- On the Relational backend, Respect would automatically build a query similar to `SELECT * FROM article INNER JOIN author ON article.author_id = author.id WHERE author.id = 5`.
- On the Structural backend for MongoDB, the generated internal query would be something like `db.article.find({"author.id":5}, {"author":1});`.

Features
--------

[](#features)

Besides fetching data from databases, Respect\\Data is expected to deal with several other scenarios:

- Persisting data into collections
- Using backend-native extra commands in queries
- Declaring shortcuts for large collection declarations
- Handling composite mapper backends

License
-------

[](#license)

See [LICENSE](LICENSE) file.

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance64

Regular maintenance activity

Popularity35

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 69.8% 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 ~187 days

Total

5

Last Release

4197d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/202642?v=4)[Alexandre Gomes Gaigalas](/maintainers/alganet)[@alganet](https://github.com/alganet)

![](https://avatars.githubusercontent.com/u/154023?v=4)[Henrique Moody](/maintainers/henriquemoody)[@henriquemoody](https://github.com/henriquemoody)

![](https://www.gravatar.com/avatar/aef3ebfba857504b29c8c54d3df12397cec9cc4b1a0890a799a7dc8d9c8c01ad?d=identicon)[Respect](/maintainers/Respect)

![](https://www.gravatar.com/avatar/4343df4adee634d5953da73aa5b61e4af61dbd37bf4e97449240c8a32c142dc5?d=identicon)[augustohp](/maintainers/augustohp)

![](https://avatars.githubusercontent.com/u/966337?v=4)[Antonio Spinelli](/maintainers/tonicospinelli)[@tonicospinelli](https://github.com/tonicospinelli)

---

Top Contributors

[![alganet](https://avatars.githubusercontent.com/u/202642?v=4)](https://github.com/alganet "alganet (60 commits)")[![henriquemoody](https://avatars.githubusercontent.com/u/154023?v=4)](https://github.com/henriquemoody "henriquemoody (18 commits)")[![nickl-](https://avatars.githubusercontent.com/u/1404606?v=4)](https://github.com/nickl- "nickl- (6 commits)")[![rogeriopradoj](https://avatars.githubusercontent.com/u/443391?v=4)](https://github.com/rogeriopradoj "rogeriopradoj (1 commits)")[![zeebinz](https://avatars.githubusercontent.com/u/341424?v=4)](https://github.com/zeebinz "zeebinz (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/respect-data/health.svg)

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

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k117.2M118](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[pgvector/pgvector

pgvector support for PHP

198741.5k12](/packages/pgvector-pgvector)[jfelder/oracledb

Oracle DB driver for Laravel

11518.4k](/packages/jfelder-oracledb)

PHPackages © 2026

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