chance-fyi / hyperf-database-sqlserver
Add SqlServer support to Hyperf
Package info
github.com/Chance-fyi/hyperf-database-sqlserver
pkg:composer/chance-fyi/hyperf-database-sqlserver
Requires
- php: >=8.0
- ext-pdo: *
- hyperf/db-connection: ^3.0
- hyperf/task: ^3.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- hyperf/config: ^3.0
- mockery/mockery: ^1.0
- phpstan/phpstan: ^1.0
- swoole/ide-helper: ^4.5
Suggests
- swow/swow: Required to create swow components.
This package is auto-updated.
Last update: 2026-06-09 06:44:24 UTC
README
Extending the SqlServer driver for Hyperf ORM through AOP and simulating coroutines using the Task component.
Installation
composer require chance-fyi/hyperf-database-sqlserver
Configuration
Configure a SQL Server connection in config/autoload/databases.php as usual.
Every query is dispatched to a task worker (to simulate coroutines over the
blocking PDO/ODBC driver), and that task has an execute timeout.
Task timeout
By default the task execute timeout is 10 seconds (the Hyperf Task default).
A heavy query that legitimately runs longer than 10s would otherwise fail with
Task [N] execute timeout. Raise it per connection with the task_timeout
option (in seconds):
// config/autoload/databases.php return [ 'sqlsrv' => [ 'driver' => 'sqlsrv', // host / database / username / password / ... 'task_timeout' => 60, // optional, seconds, default 10 ], ];