From 46ec23b944d4abba38db8dc67e10bb35a78e4077 Mon Sep 17 00:00:00 2001 From: Henrik Volckmer Date: Fri, 11 Aug 2023 06:33:46 -0400 Subject: [PATCH] Added aliases for connection types --- src/Database/Connection.php | 4 ++-- src/Facade/DB.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Database/Connection.php b/src/Database/Connection.php index 3698676..2763bd9 100644 --- a/src/Database/Connection.php +++ b/src/Database/Connection.php @@ -27,7 +27,7 @@ protected function getPdoFromParams(array $params): ?PDO $params['username'], $params['password'] ), - 'postgres' => new PDO( + 'pgsql', 'postgres' => new PDO( // pgsql:host=;port=;dbname=;user=;password= 'pgsql:host='.$params['host'].';port='.($params['port'] ?? 5432).';dbname='.$params['schema']. ';user='.$params['username']. @@ -37,7 +37,7 @@ protected function getPdoFromParams(array $params): ?PDO // sqlite: 'sqlite:'.($params['path'] ?? ':memory:') ), - 'sqlsrv' => new PDO( + 'mssql', 'sqlsrv' => new PDO( // sqlsrv:Server=,;Database= 'sqlsrv:Server='.$params['host'].','.($params['port'] ?? 1521).';Database='.$params['schema'], $params['username'], diff --git a/src/Facade/DB.php b/src/Facade/DB.php index a2e98bd..cbfa9f1 100644 --- a/src/Facade/DB.php +++ b/src/Facade/DB.php @@ -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); }