db2 driver updates
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Database\Db2\Db2Connection;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use PDO;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
@@ -13,7 +13,7 @@ class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
DB::extend('odbc', function (array $config, string $name): Db2Connection {
|
||||
$pdo = new PDO(
|
||||
'odbc:' . ($config['dsn'] ?? 'MEDIUK'),
|
||||
'odbc:'.($config['dsn'] ?? 'MEDIUK'),
|
||||
$config['username'] ?? '',
|
||||
$config['password'] ?? '',
|
||||
[
|
||||
@@ -47,6 +47,7 @@ class AppServiceProvider extends ServiceProvider
|
||||
}
|
||||
|
||||
$pdo->exec('SET CURRENT SCHEMA '.$schema);
|
||||
|
||||
return strtoupper($schema);
|
||||
}
|
||||
|
||||
@@ -58,7 +59,5 @@ class AppServiceProvider extends ServiceProvider
|
||||
return rtrim($currentSchema);
|
||||
}
|
||||
|
||||
public function boot(): void
|
||||
{
|
||||
}
|
||||
public function boot(): void {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user