yajra / laravel-oci8

Oracle DB driver for Laravel via OCI8

Home Page:https://yajrabox.com/docs/laravel-oci8

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

New "sessionVars" connection added in src/config/oracle.php accidentally?

mmic-bjohnson opened this issue · comments

Summary of problem or feature request

The commit 1cc5170 introduced a new top-level array element with the key sessionVars that appears to be treated as another separate database connection, which causes undefined array key "driver" when running tests that use the RefreshDatabase trait to start transactions on all database connections.

Was the intention for that new sessionVars to be defined as a child element of the oracle array in that file?

In other words, should that structure be like this instead?

<?php

return [
    'oracle' => [
        'driver'         => 'oracle',
        'tns'            => env('DB_TNS', ''),
        'host'           => env('DB_HOST', ''),
        'port'           => env('DB_PORT', '1521'),
        'database'       => env('DB_DATABASE', ''),
        'service_name'   => env('DB_SERVICE_NAME', ''),
        'username'       => env('DB_USERNAME', ''),
        'password'       => env('DB_PASSWORD', ''),
        'charset'        => env('DB_CHARSET', 'AL32UTF8'),
        'prefix'         => env('DB_PREFIX', ''),
        'prefix_schema'  => env('DB_SCHEMA_PREFIX', ''),
        'edition'        => env('DB_EDITION', 'ora$base'),
        'server_version' => env('DB_SERVER_VERSION', '11g'),
        'load_balance'   => env('DB_LOAD_BALANCE', 'yes'),
        'max_name_len'   => env('ORA_MAX_NAME_LEN', 30),
        'dynamic'        => [],
        'sessionVars' => [
            'NLS_TIME_FORMAT'         => 'HH24:MI:SS',
            'NLS_DATE_FORMAT'         => 'YYYY-MM-DD HH24:MI:SS',
            'NLS_TIMESTAMP_FORMAT'    => 'YYYY-MM-DD HH24:MI:SS',
            'NLS_TIMESTAMP_TZ_FORMAT' => 'YYYY-MM-DD HH24:MI:SS TZH:TZM',
            'NLS_NUMERIC_CHARACTERS'  => '.,',
        ],
    ],
];

System details

  • Operating System: Ubutu 22.04 LTS
  • PHP Version: 8.1
  • Laravel Version: v9.52.8
  • Laravel-OCI8 Version: v9.5.0

@mmic-bjohnson thank you for pointing this out. Yes, that is the correct structure.

Fixed on v10.3.1 🚀, please check and confirm. Thanks!

Thanks, @yajra !

This issue exists in the 9.x branch, too. Would you be willing to implement this fix there, too?

@mmic-bjohnson thanks for the info. If you can, please do not hesitate to submit a PR.