Skip to content

Latest commit

 

History

History
37 lines (28 loc) · 1.41 KB

File metadata and controls

37 lines (28 loc) · 1.41 KB

Hyperf ORM's SqlServer driver.

Latest Stable Version Total Downloads License

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
    ],
];