SQLite3
Jesse Phillips via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Wed May 7 22:57:36 PDT 2014
On Wednesday, 7 May 2014 at 06:21:10 UTC, Jack wrote:
> First off a Disclaimer: I'm a noob and still learning. Please
> don't bash me like some forums.
>
> Now to the questions: I'm searching for a quick and easy way to
> integrate SQLite3 in my application. I came across the
> etc.c.sqlite3 and the DSQLite
> library(https://github.com/bioinfornatics/DSQLite).
>
> Thinking that the C bindings is more documented I tried learning
> that. Though I can't understand the arguements of the callback
> function.
>
> extern(C) int callback(
> void* NotUsedAtAll, // Null variable
> int argc, // What?
> char** results, // Results?
> char** columnNames //Column Names?
>
> ){
>
> for(int i = 0; i<argc; i++){
> writeln(results);
> getchar();
> }
>
> I've been reading through many explanations about this and I
> understand why the callback is needed but I can't seem to
> understand how to really use the callback function. Can someone
> provide a brief explanation or just point me in the right
> direction?
May as well throw an undocumented library at you:
https://github.com/JesseKPhillips/SQLite3-D
I only used it to pull data out of SQLite database. Once you have
your db object it is something like this.
foreach(data; db.query(statement).range!Structure)...
Where you define a struct with Nullable!() types your statement
pulls out.
More information about the Digitalmars-d-learn
mailing list