Skip to content

Chance-fyi/hyperf-database-sqlserver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Add Sql Server support to Hyperf

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors