PHPackages                             unspokenn/db-driver-pgsql - 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. unspokenn/db-driver-pgsql

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

unspokenn/db-driver-pgsql
=========================

The tenancy/tenancy database driver for Pgsql

07PHP

Since Jul 10Pushed 11mo agoCompare

[ Source](https://github.com/unspokenn/db-driver-pgsql)[ Packagist](https://packagist.org/packages/unspokenn/db-driver-pgsql)[ RSS](/packages/unspokenn-db-driver-pgsql/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

> Warning: This package is currently in the development phase and has not been fully tested. It will be tested alongside my own project and a stable version will be released.

About
-----

[](#about)

tenancy/tenancy pgsql database connection driver. The package has been created by modifying the official MySQL driver and works on Laravel 11+ (the Doctrine/DBAL dependency has been removed).

Requirements
------------

[](#requirements)

- Because this package runs specific "elevated permissions" queries in order to provide a database and a database user, the user defined in ***database.php*** needs to have the ability to create users, databases, and grant privileges.

The following is a sample query to create a user with those privileges.

`CREATE DATABASE "tenancy";`

`CREATE ROLE "tenancy" SUPERUSER CREATEDB CREATEROLE LOGIN PASSWORD 'someRandomPassword';`

> Note: The above command is simply an example. It will grant full access to all databases to the ***tenancy*** user. Please consult your teams security professional.

- The ***affects-connections*** package is required by this package in order to transfer the database from one database user to another when the database user. This change occurs when the Tenant is updated causing a new database username within the ***hooks-database*** package.

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

[](#installation)

### Using Tenancy/Framework

[](#using-tenancyframework)

Install via composer:

`composer require unspokenn/db-driver-pgsql`

### Using Tenancy/Tenancy or with provider discovery disabled

[](#using-tenancytenancy-or-with-provider-discovery-disabled)

Register the following ServiceProvider:

- `Tenancy\Database\Drivers\Pgsql\Provider::class`

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

[](#configuration)

Detailed configuration steps are located in the ***hooks-database*** package and the ***affects-connections*** package.

In general there are several ways of setting the tenant database configuration for PgSql:

- Reusing a connection configured in ***database.php*** under ***connections***.
- Load a configuration array from a separate file.

### Example

[](#example)

In the example below we will configure the database to be created using the information from the ***pgsql*** database connection defined in the ***config/database.php*** and add Tenancy's default database settings to this.

`$event->useConnection('pgsql', $event->defaults($event->tenant));`

###  Health Score

16

—

LowBetter than 4% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity14

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/ec5dbdf6a30c15dcd85f722ee648f5cb07a5124399a62bc449e20781d89d738f?d=identicon)[unspoken](/maintainers/unspoken)

---

Top Contributors

[![unspokenn](https://avatars.githubusercontent.com/u/3756497?v=4)](https://github.com/unspokenn "unspokenn (9 commits)")

### Embed Badge

![Health badge](/badges/unspokenn-db-driver-pgsql/health.svg)

```
[![Health](https://phpackages.com/badges/unspokenn-db-driver-pgsql/health.svg)](https://phpackages.com/packages/unspokenn-db-driver-pgsql)
```

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k117.2M118](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[jfelder/oracledb

Oracle DB driver for Laravel

11518.4k](/packages/jfelder-oracledb)

PHPackages © 2026

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