承接 unspokenn/db-driver-pgsql 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

unspokenn/db-driver-pgsql

Composer 安装命令:

composer require unspokenn/db-driver-pgsql

包简介

The tenancy/tenancy database driver for Pgsql

README 文档

README

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

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

  • 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

Using Tenancy/Framework

Install via composer:

composer require unspokenn/db-driver-pgsql

Using Tenancy/Tenancy or with provider discovery disabled

Register the following ServiceProvider:

  • Tenancy\Database\Drivers\Pgsql\Provider::class

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

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));

统计信息

  • 总下载量: 7
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-06-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固