PHPackages                             jengo/schema - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. jengo/schema

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jengo/schema
============

A schema package for CodeIgniter 4 applications.

v1.0.1(1mo ago)014MITPHP

Since Feb 3Pushed 1mo agoCompare

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

READMEChangelogDependencies (6)Versions (3)Used By (0)

Jengo Schema
============

[](#jengo-schema)

Declarative schema-driven querying for CodeIgniter 4

Jengo Schema is an experimental package that brings structured, schema-based querying, relationship derivation, and entity hydration to CodeIgniter 4 applications.

Development Status
------------------

[](#development-status)

This package is currently in active development (dev version). APIs may change

Behavior is still being validated Not recommended for production yet

That said, it is already usable for: Local development Prototyping Internal tools Early adopters who want to help test We are targeting a beta release shortly, followed by a stable v1.0 once the fluent query builder is finalized.

Key Features
------------

[](#key-features)

- Schema-first design using PHP attributes
- Declarative relationships (BelongsTo, HasMany)
- Automatic join resolution
- Nested derivation (derive('members.user'))
- Request-aware query options (OPEN mode)
- Inline programmatic queries (INLINE mode)
- Deterministic query planning
- Entity hydration
- Debug tools (Explain, QueryLogger)

Core Concepts
-------------

[](#core-concepts)

### Schema

[](#schema)

A schema describes: The CI4 model The entity Fields and relationships How data should be derived Schemas are the source of truth for queries.

### Query Modes

[](#query-modes)

INLINE — programmatic, explicit options OPEN — request-driven, REST-friendly

#### Example Usage

[](#example-usage)

```
use Jengo\Schema\Query\Query;
use Jengo\Schema\Query\DTO\QueryOptions;

$result = Query::run(
    schema: UserSchema::class,
    options: new QueryOptions(
        derive: ['profile'],
        pagination: new PaginationOptions(limit: 10),
    )
);
```

`Fluent API (coming soon)`

```
query(UserSchema::class)
    ->inline()
    ->where('id', 1)
    ->derive('profile')
    ->first();
```

### Debugging

[](#debugging)

#### Explain

[](#explain)

Inspect how a query is planned before execution.

```
Explain::for(UserSchema::class)
    ->derive(['profile'])
    ->dump();
```

#### Query Logger

[](#query-logger)

Track executed queries, joins, and execution time.

```
config('Schema')->logger = true;
```

### Testing

[](#testing)

This package includes:

- Unit tests for schema reflection
- Relationship graph validation
- Query plan tests
- Integration tests with CI4’s testing database

Contributions that improve test coverage are welcome.

Roadmap
-------

[](#roadmap)

- Schema reflection
- Relationship graph
- Query planning
- Hydration
- Fluent query builder
- Better error messages
- Performance benchmarks
- Beta release
- Stable v1.0

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

[](#contributing)

This project is still evolving. Feedback, issues, and ideas are welcome.

License
-------

[](#license)

MIT

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance91

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 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 ~59 days

Total

2

Last Release

45d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6a00939d7e5422a294a7b9b186f29116de3dca2d793453c8c58c0293bd2346b2?d=identicon)[gilads-otiannoh254](/maintainers/gilads-otiannoh254)

---

Top Contributors

[![gilads-otiannoh24](https://avatars.githubusercontent.com/u/180090128?v=4)](https://github.com/gilads-otiannoh24 "gilads-otiannoh24 (6 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jengo-schema/health.svg)

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

###  Alternatives

[hermawan/codeigniter4-datatables

Serverside Datatables library for CodeIgniter4

10943.0k3](/packages/hermawan-codeigniter4-datatables)[jason-napolitano/codeigniter4-cart-module

A basic port of the codeigniter 3 cart module for CodeIgniter 4.

5814.8k](/packages/jason-napolitano-codeigniter4-cart-module)

PHPackages © 2026

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