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

Remove charset config for doctrine-bundle v2 #693

Merged
1 commit merged into from Nov 28, 2019
Merged

Remove charset config for doctrine-bundle v2 #693

1 commit merged into from Nov 28, 2019

Conversation

nicolas-grekas
Copy link
Member

Q A
License MIT
Doc issue/PR -

Requires doctrine/DoctrineBundle#1070 before merging.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Pull request passes validation.

Copy link
Contributor

@alcaeus alcaeus left a comment

Choose a reason for hiding this comment

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

Change has been merged to DoctrineBundle and will be released later today.

# IMPORTANT: You MUST configure your db driver and server version,
# either here or in the DATABASE_URL env var (see .env file)
#driver: 'mysql'
#server_version: '5.7'
Copy link
Member

Choose a reason for hiding this comment

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

What about removing everything here? Or put another way: why would one want to configure the driver and version here instead of in the DATABASE_URL env var?

Copy link
Member

Choose a reason for hiding this comment

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

Also, the DSN are like: mysql://..., postgresql://..., sqlite://... So, why do I have to define the driver explicitly? It's just the first word of the DSN, right?

Copy link
Member

Choose a reason for hiding this comment

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

you might want to configure the version here in case your PaaS does not expose a serverVersion parameter in the query string (which is a Doctrine DBAL convention). This happens on Heroku for instance.

Copy link
Member Author

Choose a reason for hiding this comment

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

@dzuelke WDYT about this? Could Heroku include the serverVersion in the DATABASE_URL?

Copy link
Member Author

Choose a reason for hiding this comment

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

I removed the "driver" line but kept "server_version" for now.

Copy link

Choose a reason for hiding this comment

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

We can't, since we don't offer MySQL, @nicolas-grekas ;) That's probably a question for the folks at ClearDB and JawsDB. I generally think that the server version is more of a "static" environment thing, since your code is probably also written against the specific capabilities of a version series, so it shouldn't differ between environments, unlike the DSN.

Copy link
Member Author

Choose a reason for hiding this comment

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

That's not only for MySQL - the same is needed for PG :)
But I get your point. Actually, DoctrineBundle/DBAL could throw an exception when both settings are found but don't match (in DSN & config). That would be even more useful as it would help spot mistakes.

/cc @alcaeus in case you agree and want to create an issue there :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Pull request passes validation.

@alcaeus
Copy link
Contributor

alcaeus commented Nov 28, 2019

@nicolas-grekas does this need a rebase after the changes in #695?

@nicolas-grekas
Copy link
Member Author

No rebase needed,this is ready to go.

ghost pushed a commit that referenced this pull request Nov 28, 2019
@ghost ghost merged commit 4293dc6 into symfony:master Nov 28, 2019
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants