GoMySQL Doc ?

48 views
Skip to first unread message

flux

unread,
Jun 6, 2011, 9:19:32 AM6/6/11
to GoMySQL
Hi,

I am new to Google Go and currently I am getting deeper into it. My
aim is to build a web application based on Google Go. For this reason,
I also need to use a MySQL Database. It makes sense to use the
provided GoMySQL API for this task.

My problem right now: I could not find any documentation regarding
GoMySQL. Ok, there are 2 small examples, but it is not satisfactory,
at least for me. So is there any documentation for this API ? As I
said I am new to Go and I need more basic examples for working on a
database.

Or is there another SQL API written in Go ? :)

Thanks in advance.

Phil Bayfield

unread,
Jun 6, 2011, 10:12:33 AM6/6/11
to gom...@googlegroups.com
Hi there,

Can you give me an example of what you want to do?

Do you want to use queries or statements (I would recommend statements)?

Cheers
Phil.


--
You received this message because you are subscribed to the Google Groups "GoMySQL" group.
To post to this group, send email to gom...@googlegroups.com.
To unsubscribe from this group, send email to gomysql+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gomysql?hl=en.


flux

unread,
Jun 6, 2011, 11:43:42 AM6/6/11
to GoMySQL
I would like to process basic SQL statements. Just a simple SQL-Table,
inserting and updating data.

It is needed to create a website where you can write some stuff into a
textbox, and save this content to a persistent SQL-Database. I am
thinking of a blog-like mechanism.

regards,

flux

unread,
Jun 15, 2011, 6:51:40 AM6/15/11
to GoMySQL
Hi Phil,

with your given Statement example in the docs, I think I figured out
how to use the database.

But I have one big problem: For example when I am trying to get the
content of the database with a simple "select * from database", I get
an error with columns who have NULL entries. How can I fix this ?

regards,

Sam N

unread,
Jun 21, 2011, 1:48:30 PM6/21/11
to gom...@googlegroups.com
I reported the same issue here: https://github.com/Philio/GoMySQL/issues/52

Phil Bayfield

unread,
Jun 21, 2011, 9:48:37 PM6/21/11
to gom...@googlegroups.com
I've not really had a chance to look into this properly yet, but I suspect it's in the conversion stuff, here: https://github.com/Philio/GoMySQL/blob/master/statement.go#L429

It looks like the lack of null (nil) handling in the conversions will probably panic, which hits the defer/recover code and triggers the error you both got.

I don't have a Go install to hand at the moment as on Windows, but I'll try and check this out tomorrow, 

If in the mean time someone does get a chance to test this, push a patch and I'll review and release it instead.

Cheers
Phil.
Reply all
Reply to author
Forward
0 new messages