Skip to content

Add dotenv support for several database directives #3417

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

Closed

Conversation

baspeters
Copy link

For single database instance applications, dotenv directives like DB_HOST and DB_USERNAME can be used. However, not all directives are supported. This pull request adds support for charset, collation, prefix and schema

@baspeters
Copy link
Author

For schema and prefix I would say yes, charset and collation probably makes no sense. However I have encountered badly configured servers that would default the charset on an MSSQL dblib connection to something other than UTF8. If changing the system configuration of such a server is not an option, there is no easy way to set the charset other than creating a custom database configuration and overriding it there. Having a dotenv option to set this for a specific environment is a lot easier.

@taylorotwell
Copy link
Member

You can set these yourself.

@baspeters
Copy link
Author

These settings can indeed be set with a custom configuration, however a dotenv directive would avoid having to create this custom configuration in the first place to cater for differently behaving environments.

In light of this outcome, I'll make another PR to hardcode 'utf8' charset in the 'sqlsrv' configuration, just as it is present in the mysql and pgsql configuration.

@baspeters baspeters deleted the feature/db-config-directives branch June 11, 2015 15:12
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.

3 participants