Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/efureev/swoole-doctrine-dbal-pgsql-driver
Doctrine DBAL Driver for Swoole 5 Postgresql database connections
https://github.com/efureev/swoole-doctrine-dbal-pgsql-driver
doctrine swoole symfony
Last synced: 2 months ago
JSON representation
Doctrine DBAL Driver for Swoole 5 Postgresql database connections
- Host: GitHub
- URL: https://github.com/efureev/swoole-doctrine-dbal-pgsql-driver
- Owner: efureev
- License: mit
- Created: 2023-04-20T11:59:32.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-10T16:05:19.000Z (6 months ago)
- Last Synced: 2024-09-15T02:59:23.873Z (4 months ago)
- Topics: doctrine, swoole, symfony
- Language: PHP
- Homepage:
- Size: 36.1 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# doctrine-dbal-swoole-pgsql-driver
Doctrine DBAL Driver for Swoole 5 Postgresql database connections
## Installation
The easiest way to install this package is through composer:
```bash
$ composer require efureev/swoole-doctrine-dbal-pgsql-driver
```## Example
You can test functionality using supplied docker image, located in [example](example) folder. Cli example can be found
in [example/cli.php](example/cli.php). HTTP server example can be found in [example/server.php](example/server.php)App Config:
```yaml
doctrine:
dbal:
default_connection: 'swoole'
connections:
swoole:
dbname: '%env(DB_MASTER_NAME)%'
host: '%env(DB_MASTER_HOST)%'
port: '%env(DB_MASTER_PORT)%'
user: '%env(DB_MASTER_USER)%'
password: '%env(DB_MASTER_PASS)%'
driver_class: 'Swoole\Packages\Doctrine\DBAL\PgSQL\Driver'
server_version: '15'
options:
poolSize: 3 # MAX count connections in one pool
usedTimes: 3 # 1 connection (in pool) will be re-used maximum N queries
connectionTTL: 60 # when connection not used this time(seconds) - it will be close (free)
tickFrequency: 60000 # when need check possibilities downscale (close) opened connection to DB in pools
connectionDelay: 2 # time(seconds) for waiting response from pool
useConnectionPool: true # if false, will create new connect instead of using pool
retryMaxAttempts: 2 # if connection in pool was timeout (before use) then try re-connect
retryDelay: 1000 # delay to try fetch from pool again(milliseconds) if no connect available
```Add Bundle to the `bundles.php`:
```php
[
SwooleDoctrineDbalPoolBundle::class => ['all' => true],
]```
It's all.