Search by

jengo / schema

gilads-otiannoh254

A schema package for CodeIgniter 4 applications.

v1.0.26 2026-10-27 15:01 UTC

README

Jengo Logo

Jengo Schema

Declarative schema derivation, relational query builder with context-aware pagination clamping, and automated TypeScript definitions generator for CodeIgniter 4.

Documentation • License • Issues

Installation

composer require jengo/schema
php spark jengo:schema setup

Quick Start

use App\Schemas\OrderSchema;
use function Jengo\Schema\query;

// Query with automatic relationship derivation and pagination
$result = query(OrderSchema::class)
    ->where('status', 'completed')
    ->derive(['user', 'items'])
    ->sort('created_at', 'DESC')
    ->paginate(page: 1, limit: 15)
    ->get();

$orders = $result->data;

Model Gateway

Link models to schemas via #[UseSchema] and HasSchema:

use App\Models\OrderModel;

// Query directly from CodeIgniter 4 Model
$orders = OrderModel::schema()
    ->where('status', 'completed')
    ->derive(['user', 'items'])
    ->get()
    ->data;

Documentation

For full guides on PHP 8 schema attributes, relationship derivation, cursor pagination, virtual schemas, Open mode, and TypeScript generator options, visit https://lipex-org.github.io/jengophp.com/packages/schema.

License

Released under the MIT License.