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

Not working with MySQL #7

Closed
anidotnet opened this issue Mar 19, 2014 · 2 comments
Closed

Not working with MySQL #7

anidotnet opened this issue Mar 19, 2014 · 2 comments

Comments

@anidotnet
Copy link

Upper is not working with MySQL. Here is the sample code I have used. Go lang version I used is 1.2.1 and I have tried in both Windows 7 64 bit and Ubuntu 13.10 64bit. Upper-mysql is working in neither of them. And here is the MySQL schema I used. Am I doing something wrong here or is it a standing issue?

@xiam
Copy link
Member

xiam commented Apr 13, 2014

Nice one, Anindya.

See, your Test struct:

type Test struct {
    firstName   string  `field:"firstname"`
    lastName    string  `field:"lastname"`
}

Has two fields indeed, but the two of them are private. In order to be visible by upper.io/db fields must be public or exported (name must be capitalized).

type Test struct {
    FirstName   string  `field:"firstname"`
    LastName    string  `field:"lastname"`
}

This is mentioned nowhere, hence is a documentation bug and we'll be tracking it here https://github.com/upper/db-docs/issues/5.

@xiam xiam closed this as completed Apr 13, 2014
@anidotnet
Copy link
Author

Thanks Xiam. I should have guessed that, but I am very new to golang and learning it by some hands-on code. Thanks again for making it clear.

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