PHPackages                             th3mouk/materialized-view-bundle - 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. th3mouk/materialized-view-bundle

ActiveSymfony-bundle[Database &amp; ORM](/categories/database)

th3mouk/materialized-view-bundle
================================

Symfony bundle for th3mouk/materialized-view: autoconfiguration, console commands, the locked deploy lane, async refresh and read-only ORM guards for PostgreSQL materialized views.

v1.3.1(1mo ago)0837↓64.1%Apache-2.0PHPPHP &gt;=8.4CI passing

Since Jun 5Pushed 1mo agoCompare

[ Source](https://github.com/Th3Mouk/materialized-view-bundle)[ Packagist](https://packagist.org/packages/th3mouk/materialized-view-bundle)[ RSS](/packages/th3mouk-materialized-view-bundle/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (3)Dependencies (36)Versions (10)Used By (0)

th3mouk/materialized-view-bundle
================================

[](#th3moukmaterialized-view-bundle)

> Symfony integration for [`th3mouk/materialized-view`](../materialized-view) — manage PostgreSQL **materialized views** declaratively, with first-class support for booting the same views across many databases/connections.

The bundle adds, on top of the framework-agnostic core: **autoconfiguration** of your view definitions, **console commands** (`matview:*`), the **locked deploy lane** (`drop --if-pending → migrate → sync` in one process), **async refresh** dispatching, and **read-only ORM guards**.

Why a separate bundle
---------------------

[](#why-a-separate-bundle)

The core is intentionally framework-free (DBAL only). Everything Symfony-specific — DI, attributes, commands, Messenger, the Doctrine Migrations lane — lives here so the core can be reused and tested in isolation, and so neither package strands the other on a framework upgrade.

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

[](#installation)

```
composer require th3mouk/materialized-view-bundle
```

Requirements: **PHP ≥ 8.4**, **Symfony ≥ 8.0**, **Doctrine DBAL ≥ 4.4**, **DoctrineBundle**, **PostgreSQL** (12+). For the deploy lane, **DoctrineMigrationsBundle**; for async refresh, **Symfony Messenger** with a shared transport.

60-second setup (Symfony)
-------------------------

[](#60-second-setup-symfony)

1. Register the bundle (Flex usually does this) in `config/bundles.php`:

```
return [
    // ...
    Th3Mouk\MaterializedViewBundle\Th3MoukMaterializedViewBundle::class => ['all' => true],
];
```

2. Declare a view — a `.sql` file plus an attributed PHP class (auto-discovered, no interface):

```
use Th3Mouk\MaterializedView\Core\Definition\MaterializedViewDefinition;
use Th3Mouk\MaterializedViewBundle\Attribute\AsMaterializedViewProvider;

#[AsMaterializedViewProvider]
final class SalesByCategoryView
{
    public function definitions(): iterable
    {
        yield MaterializedViewDefinition::create('public.sales_by_category')
            ->fromSql(/* db/matviews/sales_by_category.sql */);
    }
}
```

3. Wire the deploy lane (per database) — see [boot lane](docs/guide/boot-lane.md):

```
php -d memory_limit=512M bin/console matview:doctrine-lane --no-interaction
```

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

[](#documentation)

TierAudienceStart here**Getting started**Users — wire it into Symfony fast[`docs/getting-started.md`](docs/getting-started.md)**Guide**Users — commands, config, boot lane, async, templates[`docs/guide/`](docs/guide/)**Internals**Maintainers — design &amp; Symfony/Doctrine references[`docs/internals/`](docs/internals/)Core concepts (definitions, rebuilds, refresh, locking, hashing, ORM) are documented in the [native library docs](../materialized-view/docs/). This bundle's docs cover the Symfony surface and link back.

Compatibility
-------------

[](#compatibility)

This bundlePHPSymfonyDoctrineBundleMigrations (optional)Core`^1.0`≥ 8.4^8.0^2.13^4.0`th3mouk/materialized-view:^1.0`License
-------

[](#license)

[Apache-2.0](LICENSE) — Copyright © 2026 Jérémy Marodon (th3mouk). See [`NOTICE`](NOTICE).

If you use or redistribute this package, keep the [`NOTICE`](NOTICE) attribution — crediting **Jérémy Marodon (th3mouk)** and naming this library in your product's documentation or credits. Please [contribute](CONTRIBUTING.md) upstream rather than maintaining a public fork.

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance94

Actively maintained with recent releases

Popularity20

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 ~3 days

Total

7

Last Release

31d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5006899?v=4)[Jérémy](/maintainers/Th3Mouk)[@Th3Mouk](https://github.com/Th3Mouk)

---

Top Contributors

[![Th3Mouk](https://avatars.githubusercontent.com/u/5006899?v=4)](https://github.com/Th3Mouk "Th3Mouk (15 commits)")

---

Tags

symfonydoctrinepostgresqlreportinganalyticsSymfony Bundledoctrine-migrationsread modelmaterialized view

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/th3mouk-materialized-view-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/th3mouk-materialized-view-bundle/health.svg)](https://phpackages.com/packages/th3mouk-materialized-view-bundle)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M400](/packages/easycorp-easyadmin-bundle)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9421.6k64](/packages/open-dxp-opendxp)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k14](/packages/2lenet-crudit-bundle)

PHPackages © 2026

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