PHPackages                             unapartidamas/weaver-orm - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. unapartidamas/weaver-orm

ActiveLibrary[Database &amp; ORM](/categories/database)

unapartidamas/weaver-orm
========================

PHP 8.4+ ORM for Symfony. Zero reflection, no proxies, no memory leaks. Worker-safe by design.

v1.2.1(1mo ago)026↓90.9%MITPHPPHP ^8.4CI passing

Since Apr 2Pushed 1mo agoCompare

[ Source](https://github.com/Unapartidamas/weaverORM)[ Packagist](https://packagist.org/packages/unapartidamas/weaver-orm)[ RSS](/packages/unapartidamas-weaver-orm/feed)WikiDiscussions main Synced 4w ago

READMEChangelogDependencies (14)Versions (9)Used By (0)

Weaver ORM
==========

[](#weaver-orm)

A modern, high-performance ORM for PHP 8.4+. Zero reflection, no proxy classes, no memory leaks, no Doctrine dependency. Worker-safe by design.

Compatible with **Symfony**, **Laravel**, and **CodeIgniter 4**.

Benchmarks
----------

[](#benchmarks)

Weaver ORM vs Doctrine ORM vs Eloquent (SQLite in-memory, 2000 iterations, PHP 8.4):

OperationWeaver ORMDoctrine ORMEloquentWinnerSingle INSERT0.069ms0.143ms0.352ms**Weaver 2.1x**Batch INSERT (100 rows)2.89ms7.57ms27.74ms**Weaver 2.6x**SELECT by PK0.068ms0.090ms0.245ms**Weaver 1.3x**Complex SELECT0.216ms0.595ms0.519ms**Weaver 2.8x**UPDATE0.061ms0.091ms0.266ms**Weaver 1.5x**Hydration (100 rows)0.834ms2.148ms2.448ms**Weaver 2.6x****Weaver wins 6/6 benchmarks.** Run `php benchmark/run-orm-comparison.php` to reproduce.

Why Weaver?
-----------

[](#why-weaver)

Doctrine ORMEloquentWeaver ORMDependenciesdoctrine/dbal, doctrine/common, ...illuminate/database, ...**ext-pdo only**PHP version8.1+8.2+**8.4+**Proxy classesGenerated, reflection-heavyN/A (ActiveRecord)**None** (PHP 8.4 property hooks)MemoryIdentity map grows unboundedModel instances per query**Worker-safe**, request-scopedQuery languageDQLEloquent Builder**Plain SQL query builder**PyroSQLNot supportedNot supported**Native** (time travel, vectors, CDC)Requirements
------------

[](#requirements)

- **PHP 8.4+**
- **ext-pdo** (+ driver: pdo\_pgsql, pdo\_mysql, or pdo\_sqlite)

Zero framework dependencies. No Doctrine, no Symfony, no Laravel in the core.

Installation
------------

[](#installation)

```
composer require unapartidamas/weaver-orm
```

### Symfony

[](#symfony)

```
// config/bundles.php
return [
    Weaver\ORM\Bridge\Symfony\WeaverBundle::class => ['all' => true],
];
```

### Laravel

[](#laravel)

```
// config/app.php (or auto-discovered)
'providers' => [
    Weaver\ORM\Bridge\Laravel\WeaverServiceProvider::class,
],
```

### CodeIgniter 4

[](#codeigniter-4)

```
// Use the service locator
$workspace = \Weaver\ORM\Bridge\CodeIgniter\WeaverService::workspace();
```

Quick Start
-----------

[](#quick-start)

```
use Weaver\ORM\Mapping\Attribute\{Entity, Id, Column, Timestamps};

#[Entity(table: 'users')]
#[Timestamps]
class User
{
    #[Id]
    public ?int $id = null;

    #[Column]
    public string $name;

    #[Column]
    public string $email;
}
```

```
$workspace->add($user);
$workspace->push();

$users = $repo->query()
    ->where('name', 'LIKE', '%ali%')
    ->orderBy('created_at', 'DESC')
    ->limit(10)
    ->get();

$workspace->delete($user);
$workspace->push();
```

Configuration
-------------

[](#configuration)

```
# config/packages/weaver.yaml
weaver:
    connections:
        default:
            driver: pdo_pgsql  # pdo_mysql, pdo_sqlite, pyrosql
            url: '%env(DATABASE_URL)%'
    default_connection: default
    debug: '%kernel.debug%'
    n1_detector: '%kernel.debug%'
```

API
---

[](#api)

DoctrineWeaverDescription`persist()``add()`Track a new entity`flush()``push()`Write all changes to DB`remove()``delete()`Mark for deletion`detach()``untrack()`Stop tracking entity`contains()``isTracked()`Check if managed`refresh()``reload()`Re-read from DB`clear()``reset()`Clear tracked entities`EntityManager``EntityWorkspace`Main entry pointFeatures
--------

[](#features)

**Core** - Entity mapping with attributes, HasOne/HasMany/BelongsTo/BelongsToMany/MorphOne/MorphMany relations, identity map, change tracking, lazy loading (PHP 8.4 hooks), optimistic + pessimistic locking, nested embeddables, single-table + joined-table inheritance, batch operations, criteria pattern.

**Query Builder** - Fluent API, global/local scopes, runtime filter toggle, eager loading, cursor + offset pagination, query result caching.

**Caching** - Second Level Cache (PSR-16), query result cache, per-entity cache regions.

**Multi-Database** - Named connections, `#[Connection('analytics')]` per entity, WorkspaceRegistry, read/write splitting.

**Schema** - Generation from mappers, diff, validation. Commands: `schema:create`, `schema:update`, `schema:drop`, `schema:diff`.

**Events** - Lifecycle hooks (`#[BeforeAdd]`, `#[AfterAdd]`, etc.), priorities, Symfony/Laravel/CI4 dispatcher integration.

**Testing** - `EntityFactory`, `DatabaseTransactions` trait, `RefreshDatabase` trait, SQLite in-memory.

**Profiling** - Query profiler, N+1 detection, Symfony Web Debug Toolbar.

**PyroSQL** - Time travel (AS OF), branching, CDC, approximate queries, vector search, WASM UDFs, native syntax (FIND, ADD, CHANGE, REMOVE, SEARCH, NEAREST).

Migrating from Doctrine
-----------------------

[](#migrating-from-doctrine)

```
use Weaver\ORM\Bridge\Doctrine\DoctrineCompatEntityManager;

$em = new DoctrineCompatEntityManager($workspace);
$em->persist($entity);  // calls $workspace->add()
$em->flush();            // calls $workspace->push()
```

Documentation
-------------

[](#documentation)

[unapartidamas.github.io/weaverORM](https://unapartidamas.github.io/weaverORM/)

License
-------

[](#license)

[MIT](LICENSE)

###  Health Score

43

—

FairBetter than 90% of packages

Maintenance90

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~5 days

Total

8

Last Release

52d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/513ca9271381be649257a2a7a81ab7cd23279a9efb20822660e636d84a564334?d=identicon)[jovendigital](/maintainers/jovendigital)

---

Top Contributors

[![unapartidamasSL](https://avatars.githubusercontent.com/u/164913786?v=4)](https://github.com/unapartidamasSL "unapartidamasSL (14 commits)")

---

Tags

phpsymfonydatabaseormmapperpyrosql

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Type Coverage Yes

### Embed Badge

![Health badge](/badges/unapartidamas-weaver-orm/health.svg)

```
[![Health](https://phpackages.com/badges/unapartidamas-weaver-orm/health.svg)](https://phpackages.com/packages/unapartidamas-weaver-orm)
```

###  Alternatives

[wayofdev/laravel-cycle-orm-adapter

🔥 A Laravel adapter for CycleORM, providing seamless integration of the Cycle DataMapper ORM for advanced database handling and object mapping in PHP applications.

3635.8k3](/packages/wayofdev-laravel-cycle-orm-adapter)[pomm/pomm-bundle

The Symfony2 bundle for Postgresql Object Model Manager

3030.3k1](/packages/pomm-pomm-bundle)[fourlabs/qbjs-parser-bundle

This bundle is a Symfony wrapper for fourlabs/qbjs-parser.

1514.8k1](/packages/fourlabs-qbjs-parser-bundle)[modul-is/orm

Lightweight hybrid ORM/Explorer

1119.0k](/packages/modul-is-orm)[bauer01/unimapper

Universal mapping tool for collecting data from different sources

102.6k6](/packages/bauer01-unimapper)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
