承接 jengo/schema 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jengo/schema

最新稳定版本:v1.0.1

Composer 安装命令:

composer require jengo/schema

包简介

A schema package for CodeIgniter 4 applications.

README 文档

README

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

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

  • 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

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

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

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

Explain

Inspect how a query is planned before execution.

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

Query Logger

Track executed queries, joins, and execution time.

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

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

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

Contributing

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

License

MIT

统计信息

  • 总下载量: 25
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固