-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PDO::FETCH_KEY_PAIR Missing from FetchMode Constants #3111
Comments
@chrisguitarguy it is intentional because this mode is only supported in PDO but not other underlying drivers. We may want to implement it across platforms in |
You can still use the constant in 2.x though and it should work as long as you use PDO-based driver. Note that it'll emit deprecation warning now in 2.x since it's not explicitly supported a fetch mode across drivers. Marking as feature request for 3.0 where it may eventually become a supported FetchMode. |
Ah, I gotcha. Didn't think about non-PDO drivers. For what it's worth, I "fixed" my own deprecation warning by just doing |
@chrisguitarguy you probably can use |
Looked into this a bit more and I think I pretty much understand how it would get implemented. PDO stuff just works, but things like the mysqli, oci, and sql server drivers would need a supported added in their Is that on the right track? I've only every fixed stuff in DBAL for postgres and mysql, are there docs on how to run the OCI or other tests anywhere? |
@chrisguitarguy, please hold off on implementing it. While it's technically possible, currently, there's no proper place to put the implementation. If it's implemented on the As for testing on OCI, your options are:
|
Would this be the proper place to also add that |
@thomask let's leave it here for now. |
I guess these changes mean that |
@dave-redfern the implementation itself is not difficult. The point is that we don't want to reimplement it across drivers, we want things like that to be implementable once on the wrapper level. But it requires API redesign. |
This seems to be the thread for missing fetch modes :-) +1 for Besides those mentioned above, I also often use And +1 for In fact, another way to look at this is to split off the decision whether everything should be keyed by the first column or not, which I'd find more intuitive as an API user, though it's conceptually different from PHP's PDO API. For the "value" side, there's things like So |
I don't have my computer at hand, so I can't find the original thread for this, but we are actually trying to reduce the supported fetch modes, as they are simple function composition patterns complicated by bitmasking, and they are trivial to implement in userland. |
So when I'm using plain PDO in PHP, is there no performance benefit when I'm using |
Generally not noticeable: still, I wouldn't rely on the underlying PDO layer to arrange data fir you, as the various PDO implementations are extremely quirky. Seriously, the less PDO-specific details you use, the better. |
I am re-evaluating all issues currently associated with the doctrine/dbal 3.0.0 milestone. Removing the milestone for now on this issue while we try to narrow in on the most critical issues required to release 3.0.0. This issue is still important but it may not happen in 3.0.0 |
Fixed in #4293. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
There's no constant in
Doctrine\DBAL\FetchMode
forPDO::FETCH_KEY_PAIR
.Was this intentional? Could it be added? Happy to send a PR for this, but wasn't sure if the omission was intentional.
See also #3082 where FETCH_KEY_PAIR was also mentioned.
The text was updated successfully, but these errors were encountered: