Download the PHP package dgarbs51/postgres-pooled-mode without Composer
On this page you can find all versions of the php package dgarbs51/postgres-pooled-mode. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dgarbs51/postgres-pooled-mode
More information about dgarbs51/postgres-pooled-mode
Files in dgarbs51/postgres-pooled-mode
Package postgres-pooled-mode
Short Description Drop-in Laravel support for PostgreSQL transaction poolers with direct connections for schema operations.
License MIT
Informations about the package postgres-pooled-mode
Postgres Pooled Mode for Laravel
Drop-in Laravel support for PostgreSQL transaction poolers such as PgBouncer, Neon pooled connections, PlanetScale pooled connections, and AWS RDS Proxy.
The package keeps normal application traffic on the pooled endpoint while giving schema and maintenance workflows a direct PostgreSQL endpoint for operations that do not work reliably through transaction pooling.
Installation
The service provider is auto-discovered by Laravel.
You may publish the package config:
Configuration
Add pooled and direct keys to your PostgreSQL connection:
Then set the pooler and direct endpoints:
If your pooler uses the same host but differentiates pooled and direct
connections by port and username, leave DB_DIRECT_HOST unset and provide only
the direct port and username.
What It Does
- Enables PDO emulated prepares for pooled PostgreSQL connections unless the option is explicitly configured.
- Keeps direct PostgreSQL connections on native prepares unless the direct config explicitly opts into emulated prepares.
- Adds
connection::directrouting through the package database manager. - Routes migrations to
connection::directwhen a direct endpoint is configured. - Uses the direct endpoint for PostgreSQL schema dump/load.
- Routes
db:wipe,db:show, anddb:tablethrough direct when appropriate. - Adds
php artisan db --pooled; without--pooled,php artisan dbdefaults to direct only when the raw connection config haspooled => true. - Converts PHP boolean bindings to PostgreSQL-compatible
'true'/'false'strings when PDO emulated prepares are active.
Boolean Bindings
When PDO emulated prepares are active, PostgreSQL receives the query with values interpolated on the client side. For boolean columns, bind PHP booleans:
Avoid integer boolean values under pooled emulated prepares:
Laravel cannot infer column types from an arbitrary integer binding, so 1
remains an integer literal.
Disabling Behavior
Testing
License
The MIT License (MIT). Please see LICENSE for more information.
All versions of postgres-pooled-mode with dependencies
illuminate/console Version ^11.0|^12.0|^13.0
illuminate/database Version ^11.0|^12.0|^13.0
illuminate/support Version ^11.0|^12.0|^13.0