-
Notifications
You must be signed in to change notification settings - Fork 682
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
HikariCP: config property for init connection sql added #1293
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sbeigel just looking at the Connector/J 5.1 documentation it explicitly warns...
and even recommends by default not to specify the connection string parameter
but curious if you have a different experience |
Sometimes you can't (easily) change the server settings, so I was looking for another solution. And executing "SET NAMES" for every new connection seems to work, I can read and write extended unicode chars (emojis) without problems. But this is only one (my current) usecase for this PR, so even if it's not the recommended or even a good solution for the utf8mb4 problem, having this setting in the play config is still useful! |
Right I see your point particularly if you're using Connector/J 5.1.46 (and earlier) without character_set_server=utf8mb4, then because
Definitely agree and I'm sure it will come in handy for other things, thx! |
Merged in master |
Hikari supports setConnectionInitSql() to register custom SQL to initialize a new connection. This is handy to configure the character set for the connection (e.g. "SET NAMES utf8mb4" in MySQL to make emojis etc. work ;)
I added a play config option to setup this property.