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

Feature: Set collation method alongside charset #727

Closed
gwvandesteeg opened this issue Sep 7, 2022 · 4 comments
Closed

Feature: Set collation method alongside charset #727

gwvandesteeg opened this issue Sep 7, 2022 · 4 comments

Comments

@gwvandesteeg
Copy link

When creating a connection to the DB you also want to frequently ensure the correct collation method is used in addition to the character set.

ie.
SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci
vs.
SET NAMES utf8mb4 COLLATE utf8mb4_general_ci
etc.

@lance6716
Copy link
Collaborator

lance6716 commented Sep 7, 2022

Seems another SQL driver can do it 😄

https://github.com/go-sql-driver/mysql#collation

@gwvandesteeg
Copy link
Author

Noticed it in the code for this project, pretty sure other SQL drivers handle it correctly. It's a running issue with people assuming defaults for connections and drivers are sane (they're not.. go's http.Client is a good example). Especially when it comes to character sets and collations for SQL connections (never mind the fun with mariadb vs mysql). So if I see one where it's incorrect, it gets mentioned and left for people to find and see if it's been fixed if they run into the same problem. Sadly I don't often have the time to send in a PR to fix it myself.

@dveeden
Copy link
Collaborator

dveeden commented Nov 7, 2024

I think this has been implemented since this issue was filed.

See https://github.com/go-mysql-org/go-mysql?tab=readme-ov-file#collation and the PRs mentioning "collation".

@lance6716 @atercattus If any of you agree than we can close this

@lance6716
Copy link
Collaborator

closed by #885

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

No branches or pull requests

3 participants