Repository navigation
Named column lookup for Row::get — worth adding? #11
Closed
frogdevops
started this conversation in
Ideas
Replies: 2 comments 1 reply
|
Thanks @frogdevops for using rust-oracledb . We will look into the feasibility of adding this. |
0 replies
|
This has been implemented on main. Please give it a try and let me know if there are any further changes you think worthwhile. |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem:
Right now Row::get only accepts a positional usize index (as shown in the README examples). For queries with several columns, this means every .get(n) call requires manually tracking column order from the SELECT statement, with no compiler-enforced link between the two. Reordering, adding, or removing a column in the query silently shifts every subsequent index — no compile error, just wrong data at runtime.
Okay so from what my experience is this il give examples
You will see here the query row is named the ":username" can be bind with no positional index if thats what they called or what they understood now as you can see well yeah it make sense now i have this query now i bind the values and i would be expecting the same pattern but:
it uses a positional binding which is basically as ive said if you change or reorganized it will be just a silent runtime issue where basiaclly its not that really a bigdeal for smaller stuff but it will be a headache on larger stuff.
And based on uniformity too because as patterns and semantics exist you dont want to maintain two conventional patterns inside a codebase or lets just narrow it down this function follows one and only one pattern and it must be consistent until the end.
the idea here is make it readble and safe also self documenting and it matches the patterns..
All reactions