Small Swoole Entity Manager
A persistence toolkit designed for long-running Swoole and OpenSwoole applications, with pooled connections, attribute mapping, relational builders and versioned snapshot persistence.
What is Small Swoole Entity Manager?¶
Small Swoole Entity Manager is an open-source PHP object-relational mapper (ORM) for Swoole and OpenSwoole applications. It maps PHP entities to relational tables with attributes, provides entity managers and query builders, and manages database connections in long-running worker processes.
Use the Core package for framework-independent persistence, the Symfony bundle for Symfony service integration, and Strates when a complete relational snapshot must be built before being published.
Current Core 3.1 requires PHP 8.4 or newer. The upcoming Core 3.2 atomic upsert and typed expression APIs are documented separately and are not yet in the released 3.1.0 package. Check each optional package's Composer constraints before combining versions.
For implementation decisions, see the ORM guide for Swoole and OpenSwoole and the frequently asked questions.
Built for persistent PHP runtimes¶
Coroutine-aware connections
Reuse pooled database connections safely inside long-running Swoole and OpenSwoole workers.
Explicit entity mapping
Describe fields, identifiers, relations and lifecycle behavior with PHP attributes and typed entities.
Versioned graph workflows
Combine persistence threads, transactions and Strates 1.0 snapshots to build large relational states safely.
Packages¶
Core ORM
Core 3.1 entities, managers, relational, scalar and statistics builders, persistence threads, lifecycle hooks, migrations and connection drivers.
Strates 1.0
Build immutable relational versions in isolation, parallelize independent persistence branches, then publish one complete snapshot through a release pointer. Check Strates' Composer compatibility requirements when using Core 3.1.
Symfony bundle
Version 3.0.0 integrates Core 3 with Symfony 7.4/8, contract-based factories, worker resets and selector-aware database layers.
Small Forms
Validate, normalize and hydrate API/application input before it reaches Core 3 entities. Small Forms 2.3 uses Small Collection 4 and supports entity-aware nested form workflows.
Entity Schema
Design an entity model graphically, then generate and update ORM classes without discarding custom code.
Version the state, parallelize the build, publish once
Strates separates persistence from visibility so independent transaction items can run concurrently without exposing partial relational data.
Project resources¶
The documentation source is hosted in the public documentation repository. See the project links, credits, legal notices and licence for additional information.