MySQL C API wrapper with dynamic data structures