All the SQL databases (mySQL, PostgreSQL, etc.) have at least a C API. IIRC, under the hood, Kexi uses PostgreSQL, so if you could figure out how to interface to it directly, you should be able to use libpq or libpqxx as C and C++ APIs respectively.
Otherwise, you might look at using the command-line options to export and import databases, and you can work on them in between.
|