Skip to content

Commit

Permalink
Added aliases for connection types
Browse files Browse the repository at this point in the history
  • Loading branch information
volktron committed Aug 11, 2023
1 parent 0771326 commit 46ec23b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Database/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ protected function getPdoFromParams(array $params): ?PDO
$params['username'],
$params['password']
),
'postgres' => new PDO(
'pgsql', 'postgres' => new PDO(
// pgsql:host=<host>;port=<port>;dbname=<schema>;user=<username>;password=<password>
'pgsql:host='.$params['host'].';port='.($params['port'] ?? 5432).';dbname='.$params['schema'].
';user='.$params['username'].
Expand All @@ -37,7 +37,7 @@ protected function getPdoFromParams(array $params): ?PDO
// sqlite:<path>
'sqlite:'.($params['path'] ?? ':memory:')
),
'sqlsrv' => new PDO(
'mssql', 'sqlsrv' => new PDO(
// sqlsrv:Server=<host>,<port>;Database=<schema>
'sqlsrv:Server='.$params['host'].','.($params['port'] ?? 1521).';Database='.$params['schema'],
$params['username'],
Expand Down
2 changes: 1 addition & 1 deletion src/Facade/DB.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class DB
{
static ConnectionManager $connectionManager;

public static function init($config): void
public static function init(array $config): void
{
self::$connectionManager = new ConnectionManager($config);
}
Expand Down

0 comments on commit 46ec23b

Please sign in to comment.