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

Charsets in the DSN Config is lowercase and cannot be used #1664

Closed
modelorona opened this issue Jan 25, 2025 · 3 comments · Fixed by #1679
Closed

Charsets in the DSN Config is lowercase and cannot be used #1664

modelorona opened this issue Jan 25, 2025 · 3 comments · Fixed by #1679

Comments

@modelorona
Copy link

modelorona commented Jan 25, 2025

mysql/dsn.go

Line 47 in 85c6311

charsets []string // Connection charset. When set, this will be set in SET NAMES <charset> query

Based on the README docs, shouldn't this be capitalized as to let it be used?

@methane
Copy link
Member

methane commented Jan 27, 2025

I don't like the charsets list.
I will provide functional option for charset.

@modelorona
Copy link
Author

Cool, thanks :)

@methane methane marked this as a duplicate of #1678 Feb 20, 2025
@methane
Copy link
Member

methane commented Feb 20, 2025

charset can be list. e.g. "utf8,utf8mb4,utf8mb3". In this case, user can not specify collation. Should we provide a way to multiple charset/collation pair? I don't want to do...

My current idea is:

// Charset sets charsets and collation.
//
// When collate is empty, server's default collation is used. (e.g. `SET NAMES <charset>`.)
// Otherwise, both of charset and collate is used. (e.g. `SET NAMES <charset> COLLATE <collate>`.)
func Charset(charset, collation string) Option

Should this charset supports comma separated charsets?

This was referenced Feb 23, 2025
@methane methane marked this as a duplicate of #1680 Feb 25, 2025
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 a pull request may close this issue.

2 participants