Skip to content
Coroutine-ready PHP ORM

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.

Small Swoole Entity Manager logo

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

Runtime

Coroutine-aware connections

Reuse pooled database connections safely inside long-running Swoole and OpenSwoole workers.

Model

Explicit entity mapping

Describe fields, identifiers, relations and lifecycle behavior with PHP attributes and typed entities.

Persistence

Versioned graph workflows

Combine persistence threads, transactions and Strates 1.0 snapshots to build large relational states safely.

PHP 8.4+ (Core 3.1) Swoole OpenSwoole MySQL PostgreSQL Symfony

Packages

Foundation

Core ORM

Core 3.1 entities, managers, relational, scalar and statistics builders, persistence threads, lifecycle hooks, migrations and connection drivers.

Integration

Symfony bundle

Version 3.0.0 integrates Core 3 with Symfony 7.4/8, contract-based factories, worker resets and selector-aware database layers.

Input contracts

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.

Tooling

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.

Understand the architecture

Project resources

The documentation source is hosted in the public documentation repository. See the project links, credits, legal notices and licence for additional information.