Case Sensitivity Issue with Alias Names
ymps3502 opened this issue · comments
Summary of problem or feature request
The default PDO::ATTR_CASE
in this project is set to CASE_LOWER
. However, for the requirements of my project, I need to change it to CASE_NATURAL
.
When it's set to CASE_NATURAL
, I noticed that all alias names are converted to uppercase. This behavior originates from OracleGrammar@wrapValue , which converts all alias names to uppercase.
laravel-oci8/src/Oci8/Query/Grammars/OracleGrammar.php
Lines 305 to 314 in b901e0a
> App\Models\User::select('id as user_id')->where('id', 1)->toSql()
= "select "ID" as "USER_ID" from "USERS" where "ID" = ?"
This becomes problematic when using the belongsToMany
relationship in models, as Laravel appends a pivot column (see this code). This interferes with the ability to match two models when using the with method.
Is this conversion to uppercase necessary?
System details
- Operating System: Ubuntu 22.04.3 LTS
- PHP Version: 8.0.2
- Laravel Version: 9.x
- Laravel-OCI8 Version: v9.5.0
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 7 days since being marked as stale.