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

Add support to set PostgreSQL application_name #386

Merged
merged 3 commits into from
Jan 10, 2016
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ private function configureDbalDriverNode(ArrayNodeDefinition $node)
->scalarNode('port')->defaultNull()->end()
->scalarNode('user')->defaultValue('root')->end()
->scalarNode('password')->defaultNull()->end()
->scalarNode('application_name')->end()
->scalarNode('charset')->end()
->scalarNode('path')->end()
->booleanNode('memory')->end()
Expand Down
3 changes: 2 additions & 1 deletion Resources/config/schema/doctrine-1.0.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
<xsd:attribute name="port" type="xsd:string" />
<xsd:attribute name="user" type="xsd:string" />
<xsd:attribute name="password" type="xsd:string" />
<xsd:attribute name="application_name" type="xsd:string" />
Copy link
Member

Choose a reason for hiding this comment

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

Should probably be application-name to be consistent with the other options.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought about that, but the GUC variable and the DSN part is called application_name. Wouldn't it make more sense for the users?

Copy link
Member

Choose a reason for hiding this comment

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

the XML format always uses dashes in places where YAML uses underscores (it is normalized by the config system). What makes sense for users is to respect the XML convention (they will get autocompletion based on the XSD in their IDE anyway)

<xsd:attribute name="path" type="xsd:string" />
<xsd:attribute name="unix-socket" type="xsd:string" />
<xsd:attribute name="memory" type="xsd:string" />
Expand Down Expand Up @@ -255,7 +256,7 @@
<xsd:attribute name="region-lifetime" type="xsd:integer" />
<xsd:attribute name="region-lock-lifetime" type="xsd:integer" />
</xsd:complexType>

<xsd:complexType name="dql">
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element name="string-function" type="named_scalar" />
Expand Down