I am writing a .dll-based wrapper for sqlite3 in C++. I am planning on 
providing functions to do inserts and selects and other things, it is mostly 
centred around usability for whoever uses the .dll. For example my select 
function looks like this

void*           SQL_singleSelect(char *query, char *dbName);


It returns the first result, of the first column, and the user can typecast it 
to what they want. This works fine, however I want to scale this out, and 
provide a function that returns a result set, and provides methods to help the 
user process it. For example:

SomeResultSet* SQL_select(char* query, char *dbName);


Before I dive into this and start creating classes for rows and columns, I was 
wondering about a couple of things, the first is 
sqlite3_get_table<http://www.sqlite.org/c3ref/free_table.html> - this function 
is deprecated, however the documentation says it does exactly what I want 
because it creates a result set.

I did notice in my research that someone mentioned to use 
sqlite_exec<http://sqlite.org/c3ref/exec.html> instead, however I Cannot see 
from the documentation how this actually works in regards to the call back 
functions. Does sqlite_exec create a result_table object in the same way that 
sqlite3_get_Table does? Is there any other functions that create datasets of 
results? Or am I Stuck writing (and testing) a bunch of classes that hold 
result sets and provide functions for users to get rows etc?

I figured that a well-adopted technology like this would surely already have 
ways to do this. I don't want to have to re-invent the wheel if sqlite already 
offers this kind of functionality. Any help from an experienced sqlite buff 
would be much appreciated.

I have also posted this on a forum: 
http://stackoverflow.com/questions/12137808/sqlite-wrapper-dll-best-way-to-store-result-set-and-expose-it-to-user

Cheers,

Daniel
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to