Skip to content
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

Dropped support of fetching objects and non-zero column #3070

Merged
merged 1 commit into from Apr 13, 2020

Conversation

morozov
Copy link
Member

@morozov morozov commented Mar 26, 2018

See #3066 (comment) and #2958 (comment) for the source.

Summary:

  1. FetchMode::STANDARD_OBJECT and FetchMode::CUSTOM_OBJECT are no longer supported.
  2. FetchMode::COLUMN with a non-zero index is no longer supported.
  3. Incompatible change in the Connection::fetchColumn() signature where the 3rd argument is now $types, not $columnIndex.

Reasoning:

  1. The object fetching modes exist only for parity with PDO. Fetching an object from DBAL is a poor man solution to object hydration. It works only if the DB schema and the object's properties are tightly coupled together and makes decoupling harder (see example).
  2. It's not implemented in the MySQL driver and in the caching layer without demand which means that it doesn't bother consumers.
  3. Fetching of a non-zero column is a sign of bad practice of selecting more data than needs to be fetched. Not implemented in fetch() and fetchAll() in any of the non-PDO drivers and in the caching layer.
  4. Getting rid of the above lets us get rid of the variadic $args in fetch statement methods and therefore simplify the interface.

@morozov
Copy link
Member Author

morozov commented Mar 26, 2018

Reported the AppVeyor build failure as appveyor/ci#2204.

@morozov morozov requested a review from deeky666 March 26, 2018 16:18
@morozov morozov force-pushed the stmt-fetch-mode-args-cleanup branch from 540002e to b1e9e7d Compare March 29, 2018 05:34
@morozov morozov force-pushed the develop branch 3 times, most recently from fd275f8 to c78e0e5 Compare April 9, 2018 15:30
@morozov morozov force-pushed the stmt-fetch-mode-args-cleanup branch from b1e9e7d to 8870f08 Compare April 9, 2018 17:46
@morozov morozov force-pushed the develop branch 2 times, most recently from 72cddfb to d8f1786 Compare June 6, 2018 21:46
@morozov morozov force-pushed the develop branch 3 times, most recently from 67bd64c to 7e5fb71 Compare July 2, 2018 00:52
@morozov morozov force-pushed the develop branch 2 times, most recently from c4478a0 to e5a586e Compare October 7, 2018 22:01
@morozov morozov closed this Oct 8, 2018
@morozov morozov deleted the stmt-fetch-mode-args-cleanup branch October 13, 2018 01:05
@morozov morozov self-assigned this May 23, 2019
@morozov morozov restored the stmt-fetch-mode-args-cleanup branch January 28, 2020 23:59
@morozov morozov force-pushed the stmt-fetch-mode-args-cleanup branch 3 times, most recently from 78263d5 to be09d0f Compare January 29, 2020 01:17
@morozov morozov requested review from lcobucci, beberlei and Ocramius and removed request for Majkl578, Ocramius and deeky666 January 29, 2020 02:05
@morozov morozov force-pushed the stmt-fetch-mode-args-cleanup branch from be09d0f to 5d91e02 Compare March 14, 2020 20:09
@morozov morozov changed the base branch from master to 3.0.x April 12, 2020 21:38
@morozov morozov force-pushed the stmt-fetch-mode-args-cleanup branch 3 times, most recently from 86a0bb9 to a21bfca Compare April 13, 2020 06:13
1. `FetchMode::STANDARD_OBJECT` and `FetchMode::CUSTOM_OBJECT` are no longer supported.
2. `FetchMode::COLUMN` with a non-zero index is no longer supported.
3. Incompatible change in the `Connection::fetchColumn()` signature where the 3rd argument is now `$types`, not `$columnIndex`.
@morozov morozov force-pushed the stmt-fetch-mode-args-cleanup branch from a21bfca to aa6ae1d Compare April 13, 2020 06:22
@morozov morozov requested a review from greg0ire April 13, 2020 06:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants