marko/database-pgsql
最新稳定版本:0.5.0
Composer 安装命令:
composer require marko/database-pgsql
包简介
PostgreSQL driver for Marko Framework Database Layer
README 文档
README
PostgreSQL driver for the Marko framework database layer.
Installation
composer require marko/database-pgsql
This automatically installs marko/database (the interface package) as a dependency.
Configuration
Publish or create config/database.php and set your connection details:
return [ 'default' => env('DB_CONNECTION', 'pgsql'), 'connections' => [ 'pgsql' => [ 'driver' => 'pgsql', 'host' => env('DB_HOST', '127.0.0.1'), 'database' => env('DB_DATABASE', 'marko'), 'username' => env('DB_USERNAME', 'postgres'), 'password' => env('DB_PASSWORD', ''), ], ], ];
Set the corresponding values in your .env file:
DB_CONNECTION=pgsql DB_HOST=127.0.0.1 DB_DATABASE=marko DB_USERNAME=postgres DB_PASSWORD=secret
Driver Notes
This driver supports PostgreSQL 14+.
Quick Example
use Marko\Database\Connection\ConnectionInterface; class MyService { public function __construct( private ConnectionInterface $connection, ) {} public function doSomething(): void { $result = $this->connection->query('SELECT * FROM users'); } }
Documentation
Full usage, configuration, and API reference: marko/database-pgsql
统计信息
- 总下载量: 146
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-24