From #3137883-91: Deprecate passing a StatementInterface object to Connection::query

The return value docs for \Drupal\Core\Database\Query\Query::execute() leave quite a bit to be desired. What is return depends upon the query type.

CommentFileSizeAuthor
#4 3185401-4.patch530 bytesanmolgoyal74
#2 3185401-2.patch603 bytesPooja Ganjage

Comments

mondrake created an issue. See original summary.

Pooja Ganjage’s picture

StatusFileSize
new603 bytes

Hi,

Creating a patch for this issue.

Please review the patch.

Let me know if any suggestions.

Thanks.

Pooja Ganjage’s picture

Status: Active » Needs review
anmolgoyal74’s picture

StatusFileSize
new530 bytes

I think patch in #2 is not making much sense.
Another way of mentioning the return value type.

sulfikar_s’s picture

The patch in #4 seems more meaningful than the patch in #2. #4 patch applied cleanly.

So RTBC+1.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

elber’s picture

Status: Needs review » Reviewed & tested by the community
elber’s picture

I just changed the issue's status because the target on the issue summary was did.

xjm’s picture

Status: Reviewed & tested by the community » Needs work

So, uh, yes, the return value depends on the query type. However, I don't think merely adding that addresses the "quite a bit to be desired" -- it still does not tell the user what data type to expect. We should be more specific, either explaining how the return type depends on the query type, possibly giving an example, etc.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.