move connector + connection config

This commit is contained in:
prolic 2018-06-28 16:30:51 +08:00
parent 27faaffc4e
commit 860fe1144c
No known key found for this signature in database
GPG Key ID: 29722F9F48E9DE59
2 changed files with 21 additions and 0 deletions

7
src/ConnectionConfig.php Normal file
View File

@ -0,0 +1,7 @@
<?php
namespace Amp\Sql;
interface ConnectionConfig {
public function connectionString(): string;
}

14
src/Connector.php Normal file
View File

@ -0,0 +1,14 @@
<?php
namespace Amp\Sql;
use Amp\Promise;
interface Connector {
/**
* @param ConnectionConfig $config
*
* @return Promise<Connection>
*/
public function connect(ConnectionConfig $config): Promise;
}