Semitexa ORM — attribute-driven schema, connection pooling, MySQL adapter

Maintainers

Package info

github.com/semitexa/semitexa-orm

Type:semitexa-module

pkg:composer/semitexa/orm

Statistics

Installs: 55

Dependents: 11

Suggesters: 0

Stars: 0

Open Issues: 0

2026.04.05.0855 2026-04-04 11:31 UTC

README

Attribute-driven ORM with schema definition, connection pooling, and MySQL 8.0+ support.

Purpose

Maps PHP classes to database tables using PHP 8.4 attributes. Provides Swoole-compatible connection pooling, typed column definitions, relation mapping, and a filtering architecture with auto-indexed filterable fields.

Role in Semitexa

Depends on Core and Tenancy. Depended on by Cache, Media, Scheduler, Search, Storage, Workflow, and Platform modules. Central persistence layer for all database-backed functionality.

Key Features

  • #[FromTable], #[Column], #[PrimaryKey], #[Index] for schema definition
  • Relations: #[BelongsTo], #[HasMany], #[OneToOne], #[ManyToMany]
  • #[Filterable] with auto-indexing and typed filterByX() methods
  • #[Aggregate] for virtual computed fields
  • Traits: HasTimestamps, SoftDeletes, HasUuid, HasUuidV7 (BINARY(16) chronological)
  • Domain mapping via TableModel, #[AsMapper], and DomainRepository
  • Swoole Channel-based connection pool
  • MySQL 8.0+ with version detection and capability checks
  • SchemaCollector for attribute-driven schema sync

Notes

ORM resources go in Application/Db/MySQL/Model/. Domain entities live in Domain/Model/. The Resource folder is reserved for response DTOs. Connection pooling is Swoole-native using Channel-based leasing.