Skip to content

feat: add withComment method to add comments#7079

Closed
simivar wants to merge 1 commit intodoctrine:4.4.xfrom
simivar:3.10.x
Closed

feat: add withComment method to add comments#7079
simivar wants to merge 1 commit intodoctrine:4.4.xfrom
simivar:3.10.x

Conversation

@simivar
Copy link
Copy Markdown

@simivar simivar commented Aug 6, 2025

Q A
Type feature
Fixed issues #4168

Summary

This PR provides new withComment method that adds a comment at the top of query. It works for queries and statements.

@derrabus
Copy link
Copy Markdown
Member

derrabus commented Aug 7, 2025

We don't accept new features on the 3.10.x branch anymore. Please target 4.4.x.

@derrabus derrabus changed the base branch from 3.10.x to 4.4.x August 7, 2025 06:44
Copy link
Copy Markdown
Member

@derrabus derrabus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR does not contain a functional test. Our functional tests are executed on an actual database. In your case, a functional test would show me that a query with a comment built with your modified query builder is actually executable.

private function getComments(): string
{
return implode('', array_map(function ($comment) {
return sprintf('/* %s */ ', $comment);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do all database engines support this syntax for comments?

@simivar
Copy link
Copy Markdown
Author

simivar commented Aug 7, 2025

@derrabus I've opened new MR that targest 4.4.x - #7083. I've added there as well a table confirming that this style of comments is supported by all database engines currently supported by Doctrine DBAL

@simivar simivar closed this Aug 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants