PHPackages                             macpaw/postgres-schema-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. macpaw/postgres-schema-bundle

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

macpaw/postgres-schema-bundle
=============================

A Symfony bundle to add schema wrapper for postgres

v2.0.2(7mo ago)031.6k↓31.3%[1 PRs](https://github.com/MacPaw/postgres-schema-bundle/pulls)MITPHPPHP &gt;=8.3CI passing

Since Jul 21Pushed 7mo agoCompare

[ Source](https://github.com/MacPaw/postgres-schema-bundle)[ Packagist](https://packagist.org/packages/macpaw/postgres-schema-bundle)[ RSS](/packages/macpaw-postgres-schema-bundle/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (9)Dependencies (10)Versions (11)Used By (0)

Postgres Schema Bundle
======================

[](#postgres-schema-bundle)

The **Postgres Schema Bundle** provides seamless multi-tenant schema support for PostgreSQL within Symfony applications. It automatically switches PostgreSQL `search_path` based on the current request context and ensures proper schema resolution across Doctrine and Messenger.## Installation

Features
--------

[](#features)

- Automatically sets PostgreSQL `search_path` from request headers.
- Validates that the schema exists in the database.
- Works only if the configured database driver is PostgreSQL.
- Integrates with [Schema Context Bundle](https://github.com/macpaw/schema-context-bundle).
- Compatible with Symfony Messenger and Doctrine ORM.

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

[](#installation)

Use Composer to install the bundle:

```
composer require macpaw/postgres-schema-bundle

```

### Applications that don't use Symfony Flex

[](#applications-that-dont-use-symfony-flex)

Enable the bundle by adding it to the list of registered bundles in `config/bundles.php`

```
// config/bundles.php
