Re: sqlite3 library which can read class instances (not structs)?

2025-03-15 Thread Andy Valencia via Digitalmars-d-learn
On Monday, 10 March 2025 at 21:39:39 UTC, Sergey wrote: Did you try d2sqlite3? I looked at it, and it only documented struct operations. Given that I now understand the problem at hand, I'd rather go with a fix here than start over. Thanks, Andy

Re: sqlite3 library which can read class instances (not structs)?

2025-03-10 Thread Sergey via Digitalmars-d-learn
On Thursday, 6 March 2025 at 23:45:01 UTC, Andy Valencia wrote: Is there a sqlite3 interface library which can correctly read into instances? sqlite3-d will let me compile with a class, but it segv's when run. ddbc seems to support only structs, and I can use it to punch in one value at a tim

Re: sqlite3 library which can read class instances (not structs)?

2025-03-10 Thread Andy Valencia via Digitalmars-d-learn
On Monday, 10 March 2025 at 22:55:03 UTC, Ali Çehreli wrote: You would expect that to be provided by one of the following: https://dlang.org/phobos/std_traits.html https://dlang.org/spec/traits.html But in this case it's the "is expression": https://dlang.org/spec/expression.html#is_exp

Re: sqlite3 library which can read class instances (not structs)?

2025-03-10 Thread Ali Çehreli via Digitalmars-d-learn
On 3/10/25 2:31 PM, Andy Valencia wrote: > Is there a static-if > which can tell if a type is of a struct, as opposed to a class? [...] > Something like: > >> static if (__traits(isClass, T)) { >>... >> } else if (__traits(isStruct, T)) { >>... >> } else { >>(failure) >> } > > Thank

Re: sqlite3 library which can read class instances (not structs)?

2025-03-10 Thread Andy Valencia via Digitalmars-d-learn
On Thursday, 6 March 2025 at 23:45:01 UTC, Andy Valencia wrote: Is there a sqlite3 interface library which can correctly read into instances? sqlite3-d will let me compile with a class, but it segv's when run. ddbc seems to support only structs, and I can use it to punch in one value at a tim

Re: SQLite3 and threads

2015-03-02 Thread Vitalie Colosov via Digitalmars-d-learn
Thanks for quick help. So this is related to Thread-local storage, which as I found it now, well documented, expected, and works as designed.

Re: SQLite3 and threads

2015-03-02 Thread Kagamin via Digitalmars-d-learn
On Monday, 2 March 2015 at 07:20:49 UTC, Vitalie Colosov wrote: Now it all makes sense. Thank you. Maybe it would make also some sense if I would have gotten some kind of exception trying to access the variable which was not populated by the running thread, instead of successfully getting empt

Re: SQLite3 and threads

2015-03-02 Thread Mike Parker via Digitalmars-d-learn
On 3/2/2015 4:20 PM, Vitalie Colosov wrote: Now it all makes sense. Thank you. Maybe it would make also some sense if I would have gotten some kind of exception trying to access the variable which was not populated by the running thread, instead of successfully getting empty string... so this wou

Re: SQLite3 and threads

2015-03-01 Thread Vitalie Colosov via Digitalmars-d-learn
Now it all makes sense. Thank you. Maybe it would make also some sense if I would have gotten some kind of exception trying to access the variable which was not populated by the running thread, instead of successfully getting empty string... so this would be observed easily during the testing,

Re: SQLite3 and threads

2015-03-01 Thread Ali Çehreli via Digitalmars-d-learn
On 03/01/2015 09:47 PM, Vitalie Colosov wrote: > global variable A module-scope variable is thread-local by-default. Every thread will have a copy of that variable. If you want to share data, you must define it as 'shared' (or __gshared). > which was populated in main() function In that cas

Re: SQLite3 and threads

2015-03-01 Thread Vitalie Colosov via Digitalmars-d-learn
After some analysis, it looks like related to the code parts which I have omitted "for simplicity", and in particular - I was creating the query using global variable which was populated in main() function. It appears that when I spawn the function, it does not see the value of the global varia

Re: SQLite3

2014-05-08 Thread Jack via Digitalmars-d-learn
On Thursday, 8 May 2014 at 12:47:55 UTC, Arjan wrote: On Thursday, 8 May 2014 at 11:48:14 UTC, Jack wrote: On Thursday, 8 May 2014 at 11:07:06 UTC, Arjan wrote: On Thursday, 8 May 2014 at 10:29:16 UTC, Jack wrote: On Wednesday, 7 May 2014 at 19:03:34 UTC, Arjan wrote: On Wednesday, 7 May 2014

Re: SQLite3

2014-05-08 Thread Arjan via Digitalmars-d-learn
On Thursday, 8 May 2014 at 11:48:14 UTC, Jack wrote: On Thursday, 8 May 2014 at 11:07:06 UTC, Arjan wrote: On Thursday, 8 May 2014 at 10:29:16 UTC, Jack wrote: On Wednesday, 7 May 2014 at 19:03:34 UTC, Arjan wrote: On Wednesday, 7 May 2014 at 06:21:10 UTC, Jack wrote: First off a Disclaimer: I

Re: SQLite3

2014-05-08 Thread Jack via Digitalmars-d-learn
On Thursday, 8 May 2014 at 11:07:06 UTC, Arjan wrote: On Thursday, 8 May 2014 at 10:29:16 UTC, Jack wrote: On Wednesday, 7 May 2014 at 19:03:34 UTC, Arjan wrote: 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 li

Re: SQLite3

2014-05-08 Thread Arjan via Digitalmars-d-learn
On Thursday, 8 May 2014 at 10:29:16 UTC, Jack wrote: On Wednesday, 7 May 2014 at 19:03:34 UTC, Arjan wrote: 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 fo

Re: SQLite3

2014-05-08 Thread Jack via Digitalmars-d-learn
On Wednesday, 7 May 2014 at 19:03:34 UTC, Arjan wrote: 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 appl

Re: SQLite3

2014-05-07 Thread Jesse Phillips via Digitalmars-d-learn
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

Re: SQLite3

2014-05-07 Thread Jack via Digitalmars-d-learn
On Wednesday, 7 May 2014 at 19:03:34 UTC, Arjan wrote: 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 appl

Re: SQLite3

2014-05-07 Thread Arjan via Digitalmars-d-learn
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 ?

Re: SQLite3

2014-05-07 Thread Jack via Digitalmars-d-learn
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: 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 e

Re: SQLite3

2014-05-07 Thread Robert Schadek via Digitalmars-d-learn
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

Re: SQLite3

2014-05-07 Thread Oleg via Digitalmars-d-learn
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

Re: SQLite3 segmentation at prepare statement

2013-09-19 Thread Charles Hixson
You're right about the finalize, but changing the line to: rc=sqlite3_prepare(db, toStringz(sql), cast(int)sql.length + 1000, &stmt, null); results in the compile time error: sqlitetest.d(39): Error: function etc.c.sqlite3.sqlite3_prepare (sqlite3* db, const(char)* zSql, int nByte, sqli

Re: SQLite3 segmentation at prepare statement

2013-09-19 Thread Charles Hixson
This doesn't seem to be a D problem. I re-implemented it in C and got the same error. On 09/18/2013 02:00 PM, Charles Hixson wrote: I'm trying to use SQLite3 in D, but am getting a segmentation fault when I attempt to replace the exec statement with a prepare statement. What am I doing wrong

Re: SQLite3 segmentation at prepare statement

2013-09-18 Thread growler
On Wednesday, 18 September 2013 at 21:31:00 UTC, Charles Hixson wrote: I'm trying to use SQLite3 in D, but am getting a segmentation fault when I attempt to replace the exec statement with a prepare statement. What am I doing wrong? If the prepare statement is commented out, and the exec sta