Deprecate support for unused \PDO::FETCH_* modes

Created on 4 March 2023, almost 2 years ago
Updated 31 August 2023, over 1 year ago

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_CLASSTYPE
  • \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

📌 Task
Status

Fixed

Version

11.0 🔥

Component
Database 

Last updated 2 days ago

  • Maintained by
  • 🇳🇱Netherlands @daffie
Created by

🇮🇹Italy mondrake 🇮🇹

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024