digitalmars.D.learn - SQLite3
- Jack (24/24) May 06 2014 First off a Disclaimer: I'm a noob and still learning. Please
- Oleg (3/7) May 07 2014 You can read about this agruments on
- Robert Schadek via Digitalmars-d-learn (4/28) May 07 2014 maybe
- Jack (7/49) May 07 2014 Is it bad when I only understand a small portion of the code?
- Arjan (3/7) May 07 2014 maybe:
- Jack (2/10) May 07 2014 This is what I'm talking about. Thank you very much...
- Jack (16/63) May 08 2014 I seem to have a problem with that library. Even if the modules
- Jesse Phillips (8/32) May 07 2014 May as well throw an undocumented library at you:
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 06 2014
On Wednesday, 7 May 2014 at 06:21:10 UTC, Jack wrote:void* NotUsedAtAll, // Null variable int argc, // What? char** results, // Results? char** columnNames //Column Names?You can read about this agruments on http://www.sqlite.org/c3ref/exec.html
May 07 2014
On 05/07/2014 08:21 AM, Jack via Digitalmars-d-learn 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?maybe http://forum.dlang.org/thread/mailman.44.1397577433.2763.digitalmars-d-announce puremagic.com this is something for you
May 07 2014
On Wednesday, 7 May 2014 at 08:52:04 UTC, Robert Schadek via Digitalmars-d-learn wrote:On 05/07/2014 08:21 AM, Jack via Digitalmars-d-learn wrote:Is it bad when I only understand a small portion of the code? Jokes aside, I guess this proves I'm getting ahead of myself. Thanks for the article. On Wednesday, 7 May 2014 at 07:19:32 UTC, Oleg 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?maybe http://forum.dlang.org/thread/mailman.44.1397577433.2763.digitalmars-d-announce puremagic.com this is something for youOn Wednesday, 7 May 2014 at 06:21:10 UTC, Jack wrote:Thank you for the link. I think I got it covered for now.void* NotUsedAtAll, // Null variable int argc, // What? char** results, // Results? char** columnNames //Column Names?You can read about this agruments on http://www.sqlite.org/c3ref/exec.html
May 07 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.maybe: https://github.com/buggins/ddbc/wiki ?
May 07 2014
On Wednesday, 7 May 2014 at 19:03:34 UTC, Arjan wrote:On Wednesday, 7 May 2014 at 06:21:10 UTC, Jack wrote:This is what I'm talking about. Thank you very much...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.maybe: https://github.com/buggins/ddbc/wiki ?
May 07 2014
On Wednesday, 7 May 2014 at 19:03:34 UTC, Arjan wrote:On Wednesday, 7 May 2014 at 06:21:10 UTC, Jack wrote:I seem to have a problem with that library. Even if the modules have been imported and the libraries linked and yada yada, it spews error upon error. Sample code is this: import std.stdio; import ddbc.drivers.sqliteddbc; void main(){ SQLITEDriver driver = new SQLITEDriver(); writeln("SUCCESS"); } Error spewed out is this: hello.d|7|Error: undefined identifier SQLITEDriver| I think Code::Blocks is importing the modules but not detecting the modules. Been at it for a few hours now. Any help? On Thursday, 8 May 2014 at 05:57:39 UTC, Jesse Phillips 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.maybe: https://github.com/buggins/ddbc/wiki ?On Wednesday, 7 May 2014 at 06:21:10 UTC, Jack wrote:Sounds easy enough, I'll take a look at it. Thank you ...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.
May 08 2014
On Thursday, 8 May 2014 at 10:29:16 UTC, Jack wrote:On Wednesday, 7 May 2014 at 19:03:34 UTC, Arjan wrote:Did you specify the configuration to use to dub? dub -c SQLiteOn Wednesday, 7 May 2014 at 06:21:10 UTC, Jack wrote:I seem to have a problem with that library. Even if the modules have been imported and the libraries linked and yada yada, it spews error upon error. Sample code is this: import std.stdio; import ddbc.drivers.sqliteddbc; void main(){ SQLITEDriver driver = new SQLITEDriver(); writeln("SUCCESS"); } Error spewed out is this: hello.d|7|Error: undefined identifier SQLITEDriver| I think Code::Blocks is importing the modules but not detecting the modules. Been at it for a few hours now. Any help?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.maybe: https://github.com/buggins/ddbc/wiki ?
May 08 2014
On Thursday, 8 May 2014 at 11:07:06 UTC, Arjan wrote:On Thursday, 8 May 2014 at 10:29:16 UTC, Jack wrote:Yes. I've also linked the library to it. Dub: http://puu.sh/8DYrR.png Code::Blocks Configuration: http://puu.sh/8DYug.pngOn Wednesday, 7 May 2014 at 19:03:34 UTC, Arjan wrote:Did you specify the configuration to use to dub? dub -c SQLiteOn Wednesday, 7 May 2014 at 06:21:10 UTC, Jack wrote:I seem to have a problem with that library. Even if the modules have been imported and the libraries linked and yada yada, it spews error upon error. Sample code is this: import std.stdio; import ddbc.drivers.sqliteddbc; void main(){ SQLITEDriver driver = new SQLITEDriver(); writeln("SUCCESS"); } Error spewed out is this: hello.d|7|Error: undefined identifier SQLITEDriver| I think Code::Blocks is importing the modules but not detecting the modules. Been at it for a few hours now. Any help?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.maybe: https://github.com/buggins/ddbc/wiki ?
May 08 2014
On Thursday, 8 May 2014 at 11:48:14 UTC, Jack wrote:On Thursday, 8 May 2014 at 11:07:06 UTC, Arjan wrote:Ah ok. CodeBlocks does not integrate with dub. Take a look in the dub.json file of ddbc and collect the 'versions' for the SQLite configuration (USE_SQLITE) Add those 'versions' to the DMD commandline n codeblocks: dmd.exe .... -version=USE_SQLITE -version=...On Thursday, 8 May 2014 at 10:29:16 UTC, Jack wrote:Yes. I've also linked the library to it. Dub: http://puu.sh/8DYrR.png Code::Blocks Configuration: http://puu.sh/8DYug.pngOn Wednesday, 7 May 2014 at 19:03:34 UTC, Arjan wrote:Did you specify the configuration to use to dub? dub -c SQLiteOn Wednesday, 7 May 2014 at 06:21:10 UTC, Jack wrote:I seem to have a problem with that library. Even if the modules have been imported and the libraries linked and yada yada, it spews error upon error. Sample code is this: import std.stdio; import ddbc.drivers.sqliteddbc; void main(){ SQLITEDriver driver = new SQLITEDriver(); writeln("SUCCESS"); } Error spewed out is this: hello.d|7|Error: undefined identifier SQLITEDriver| I think Code::Blocks is importing the modules but not detecting the modules. Been at it for a few hours now. Any help?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.maybe: https://github.com/buggins/ddbc/wiki ?
May 08 2014
On Thursday, 8 May 2014 at 12:47:55 UTC, Arjan wrote:On Thursday, 8 May 2014 at 11:48:14 UTC, Jack wrote:That did it! Thanks a lot. Never knew Code::Blocks was stubborn with Dlang.On Thursday, 8 May 2014 at 11:07:06 UTC, Arjan wrote:Ah ok. CodeBlocks does not integrate with dub. Take a look in the dub.json file of ddbc and collect the 'versions' for the SQLite configuration (USE_SQLITE) Add those 'versions' to the DMD commandline n codeblocks: dmd.exe .... -version=USE_SQLITE -version=...On Thursday, 8 May 2014 at 10:29:16 UTC, Jack wrote:Yes. I've also linked the library to it. Dub: http://puu.sh/8DYrR.png Code::Blocks Configuration: http://puu.sh/8DYug.pngOn Wednesday, 7 May 2014 at 19:03:34 UTC, Arjan wrote:Did you specify the configuration to use to dub? dub -c SQLiteOn Wednesday, 7 May 2014 at 06:21:10 UTC, Jack wrote:I seem to have a problem with that library. Even if the modules have been imported and the libraries linked and yada yada, it spews error upon error. Sample code is this: import std.stdio; import ddbc.drivers.sqliteddbc; void main(){ SQLITEDriver driver = new SQLITEDriver(); writeln("SUCCESS"); } Error spewed out is this: hello.d|7|Error: undefined identifier SQLITEDriver| I think Code::Blocks is importing the modules but not detecting the modules. Been at it for a few hours now. Any help?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.maybe: https://github.com/buggins/ddbc/wiki ?
May 08 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.
May 07 2014