Download the PHP package nstwf/mysql-connection-pool without Composer
On this page you can find all versions of the php package nstwf/mysql-connection-pool. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nstwf/mysql-connection-pool
More information about nstwf/mysql-connection-pool
Files in nstwf/mysql-connection-pool
Package mysql-connection-pool
Short Description Reactphp MySQL connection pool
License MIT
Informations about the package mysql-connection-pool
ReactPHP MySQL connection pool
Simple connection pool for mysql client using connection
Table of contents
- Quickstart example
- Usage
- PoolInterface
- Options
- getConnection()
- releaseConnection()
- query()
- transaction()
- PoolInterface
- Install
- Tests
- License
Quickstart example
Usage
PoolInterface
The main role of PoolInterface - managing connections with selected options
Options
waitForConnections: bool, set up the behavior while no free connections exists and user callgetConnectionmethod. If set tofalse- throws an exception, otherwise return a promise with free connection. (Default:true)connectionLimit: int, the maximum number of connections at the same time.0- for unlimited. (Default:5)
getConnection
The getConnection(): PromiseInterface<ConnectionInterface> method can be used to create a new ConnectionInterface instance if no free connections available, otherwise select one of free
releaseConnection
The releaseConnection(ConnectionInterface $connection): void method can be used to release connection to the pool
query
The query(string $sql, array $params = []): PromiseInterface<QueryResult> method is a shortcut for calls getConnection() -> query() -> releaseConnection()
transaction
The transaction(callable $callable): PromiseInterface method is a shortcut for calls: getConnection() -> transaction() -> releaseConnection():
Install
The recommended way to install this library is through Composer. New to Composer?
This project follows SemVer. This will install the latest supported version:
See also the CHANGELOG for details about version upgrades.
It's highly recommended to use PHP 8+ * for this project.
Tests
To run the test suite, you first need to clone this repo and then install all dependencies through Composer:
To run the test suite, go to the project root and run:
License
MIT, see LICENSE file.
- friends-of-reactphp/mysql - main project
- mysqljs/mysql - main concept