Core ORM · 3.3.1

Core package documentation

The foundation of Small Swoole Entity Manager: entity metadata, managers, relational builders, scalar and statistical projections, persistence coordination, lifecycle hooks and database drivers. The current Core release is 3.3.1 and requires PHP 8.4+.

Prelude Architecture and terminology

Understand the main components before configuring the ORM.

Chapter 1 Get started

Install Core 3 and create a first manager and mapped entity.

Chapter 2 Entities and fields

Map identifiers, scalar values, dates and custom field behavior.

Chapter 3 Relations and collections

Model one-to-one, one-to-many and composite relation graphs.

Chapter 4 Entity query builder

Build relational reads with joins, filters and hydrated entity results.

Core 3 Scalar and statistics builders

Project selected fields, aliases and SQL aggregates into typed scalar result sets.

Chapter 5 Update builder

Apply targeted updates without hydrating complete entities.

Core 3.2 · Released Atomic upserts and idempotency

Use mapped entities with database-enforced conflict handling.

Core 3.2 · Upcoming Typed atomic expressions

Perform safe increments, UTC lease calculations and conditional metrics.

Core 3.3 · Released Scoped ORM sessions and typed criteria

Use ORM-owned transactions, row locking, mapped writes, CAS and explicit retry policies.

Chapter 6 Delete builder

Delete rows with explicit filters and controlled query construction.

Chapter 7 Validation integration

Keep input validation outside the Core 3 persistence layer.

Chapter 8 Database layers

Track schema evolution and execute generated database changes.

Chapter 9 Transactions and persistence threads

Coordinate atomic work and concurrent persistence operations.

Chapter 10 Backups and change detection

Detect modified state and protect persistence workflows.

Chapter 11 Lifecycle hooks and bulk operations

Initialize new entities, handle database hydration and track persistence automatically.

Chapter 12 Runtime and connection drivers

Configure MySQL, PostgreSQL and Small Swoole DB runtimes.

Upgrade Upgrade to Core 3

Review dependency changes, removed form integration and new query builders.