Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 300130

Deprecate support for unused \PDO::FETCH_* modes

$
0
0

Problem/Motivation

When the Statement classes were developed, they were meant to be extensions of the base PDOStatement class.

As we moved on, Statement classes are now largely decoupled from PDO, but for fetch mode we still support all the PDO-provided modes, even though some of them are not really used - just to keep compatibility with PDO. Non-PDO drivers (and the prefetching statement) are therefore forced to develop and maintain compatibility layers to mimick PDO behavior, for no purpose.

FTR, doctrine/dbal has reduced the supported fetch modes, and dropped using \PDO::FETCH_* constants in favour of an abstract implementation.

Candidate modes for deprecation:

  • \PDO::FETCH_BOTH
  • \PDO::FETCH_CLASS
  • \PDO::FETCH_CLASS | \PDO::FETCH_CLASSTYPE
  • \PDO::FETCH_COLUMN
  • \PDO::FETCH_LAZY
  • \PDO::FETCH_INTO

Proposed resolution

Only allow these fetch modes:

  • \PDO::FETCH_ASSOC,
  • \PDO::FETCH_CLASS,
  • \PDO::FETCH_CLASS | \PDO::FETCH_PROPS_LATE,
  • \PDO::FETCH_COLUMN,
  • \PDO::FETCH_NUM,
  • \PDO::FETCH_OBJ,

Deprecate unused fetch modes for removal in a future major.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 300130

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>