Closed stephenafamo closed 1 month ago
Hi! I checked it. All ok with underscore, but there other problem. Are you sure that it needed at all? Golang and pgsql very familiar with unicode. So, what the problem is...
Example unicode enum:
create type unicode_enum as enum ('hello', 'привет', 'こんにちは', '안녕하세요', 'hello_with_underscore');
This will generate invalid code:
// Enum values for UnicodeEnum
const (
UnicodeEnumHello UnicodeEnum = "hello"
UnicodeEnum UnicodeEnum = "привет"
UnicodeEnum UnicodeEnum = "こんにちは"
UnicodeEnum UnicodeEnum = "안녕하세요"
UnicodeEnumHelloWithUnderscore UnicodeEnum = "hello_with_underscore"
)
But for golang the is no problem to have something like:
const (
UnicodeEnumHello UnicodeEnum = "hello"
UnicodeEnumПривет UnicodeEnum = "привет"
UnicodeEnumこんにちは UnicodeEnum = "こんにちは"
UnicodeEnum안녕하세요 UnicodeEnum = "안녕하세요"
UnicodeEnumHelloWithUnderscore UnicodeEnum = "hello_with_underscore"
)
Yes, I understand that in the real world hardly anyone would do this. But pgsql and golang allows it.
Thanks for spotting this bug @atzedus
This should work already, but there was an issue with Title-Casing the unicode characters. This should be fixed by #219
Fixes #216