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

Queried results end up camelcased instead of underscored #69

Closed
andriussev opened this issue Aug 12, 2013 · 5 comments
Closed

Queried results end up camelcased instead of underscored #69

andriussev opened this issue Aug 12, 2013 · 5 comments

Comments

@andriussev
Copy link

All the results with underscore names become camelcased and are not added to the returned struct if it has underscored names.
When creating the table, no warning is given about this and the table columns are not converted to camelcase either.
No mention about this in the documentation.

@eaigner
Copy link
Owner

eaigner commented Aug 12, 2013

Why would a struct have snake cased (underscored) names?

@eaigner
Copy link
Owner

eaigner commented Aug 12, 2013

snake_case is C style, Go uses CamelCase

@eaigner
Copy link
Owner

eaigner commented Aug 12, 2013

Furthermore, you can't unpack to a snake_cased name, because it would be a private struct field (because it's lowercase)

@andriussev
Copy link
Author

Well, there's no error in creating variables that have underscores. Like "User_id".
If the library converted those variable names to camelcase when creating table, then I would get it.
But it creates the table with underscores and then does not let to parse the results from the table because it converts it to camelcase when parsing, then it's a problem, in my opinion.
It at least deserves a mention in the documentation.

@eaigner
Copy link
Owner

eaigner commented Aug 12, 2013

I'd also say that this is a doc fix.

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

2 participants