I was asked some questions on IRC last night about how the query example in libAttachSQL's code base works. For those who missed previous posts, libAttachSQL is a lightweight, non-blocking, Apache 2.0 licensed C connector for MySQL servers which I am developing for HP's Advanced Technology Group.
In this blog post I'm going to break down a basic query example and explain what is happening at each step. It is possible that this syntax may change slightly by the time we hit GA but it will be similar to this.
#include <libattachsql-1.0/attachsql.h> #include <stddef.h> #include <stdio.h> #include <string.h>
Only one include is needed for the library itself, libattachsql-1.0/attachsql.h. The others are used for other functions in the code. …
[Read more]