Skip to content

Frequently asked questions

What is Small Swoole Entity Manager?

It is an open-source PHP object-relational mapper (ORM) designed for Swoole and OpenSwoole applications. It maps PHP entities with attributes, uses entity managers and query builders for persistence, and supports database connection pooling in long-running workers. See the Core overview.

Does it work without Symfony?

Yes. The Core package is framework-independent. A separate Symfony bundle provides service-container integration for projects using Symfony.

Which PHP version is required?

Current Core 3.1 requires PHP 8.4 or newer, according to its Composer requirements. Older Core 3.0 documentation described PHP 8.3 compatibility, but that is not the minimum for the current release. Always inspect the Composer constraints of the exact version being installed.

Which databases does it support?

Core has drivers for MySQL, PostgreSQL, and Small Swoole DB, an in-memory relational layer based on Swoole tables. SQL-specific features are not necessarily available on the in-memory driver. See runtime and drivers.

How are MySQL queries made coroutine-aware?

Core uses native PDO for MySQL with Swoole 6. Enable Swoole runtime hooks before database I/O. The connection pool checks a connection out to one coroutine at a time; a checked-out PDO connection must not be shared between concurrent coroutines. See MySQL driver configuration.

Can I create relationships and query them?

Yes. PHP entity attributes define relations, and relational query builders can filter, join, sort, paginate and hydrate results. See entities and collections and query builders.

Does flush() start a transaction?

No. A persistence thread's flush() executes queued operations without automatically creating a transaction. commit() behavior depends on the driver; the documented Core 3 PostgreSQL path has specific limitations. Read transactions and persistence threads before relying on atomicity.

What is Strates and when should I use it?

Strates is optional snapshot-style persistence. It builds relational versions identified by UUIDv7, keeps the previously released version visible, and publishes the candidate by changing a release pointer after the required work succeeds. It is useful for complex multi-table states, but does not automatically parallelize application code or replace local transactions. See Strates concepts.

Can I use Core 3.1 with Symfony bundle 3.0?

Not with the bundle's currently published Core constraint. Symfony bundle 3.0 declares small/swoole-entity-manager-core: 3.0.*, which excludes Core 3.1. Choose compatible versions until the bundle changes its requirements. See bundle installation.

Does the ORM validate request payloads automatically?

No. Core persistence does not depend on Small Forms and persist() does not automatically validate API input. Validate and normalize input in the application layer, optionally using Small Forms.

Is Small Swoole Entity Manager based on Doctrine ORM?

No. It provides its own managers, entity attributes, query builders and connection drivers. The Core architecture describes these components.

Where are the source code and license?

The Core code is available in the GitLab repository, and the Composer package is published on Packagist. The project uses the MIT license.