DDBI and SQLite Troubles

Chris R. Miller lordSaurontheGreat at gmail.com
Sat Jun 7 09:52:34 PDT 2008


Lars Ivar Igesund wrote:
> Chris R. Miller wrote:
> 
>> Max Samukha Wrote:
>>
>>> On Thu, 05 Jun 2008 18:25:06 -0700, "Chris R. Miller"
>>> <lordSaurontheGreat at gmail.com> wrote:
>>>
>>>> In an insane fit of daring, I started chopping up a local copy of DDBI
>>>> to figure out why I cannot get it to work with SQLite.  At first I was
>>>> receiving cryptic messages like:
>>>>
>>>> Error: identifier 'SqliteDatabase' is not defined
>>>>
>>>> And I eventually tracked it down to a bunch of version statements in the
>>>> SQLite section that prevent it from building SQLite support into the
>>>> library.  Unfortunately, when I removed those statements it presented me
>>>> with a host of errors associated with the library's internal workings.
>>>> I've been working to correct them, but the steps aren't really pertinent
>>>> to my question.
>>>>
>>>> Has anyone been maintaining the SQLite layer of DDBI, or is it either
>>>> fix it or leave it if I want to use it?
>>>>
>>>> A quick trip to DSSS's lib folder (which was built from an unmangled
>>>> copy) shows that all the drivers except for Infobase are basically not
>>>> there (4KB lib files as opposed to 73KB for ib).  I think this means
>>>> that no one has been maintaining SQLite.  Am I correct?
>>> Have you tried to compile your program with -version=dbi_sqlite?
>> That would be where the massive host of errors issued forth.  I managed to
>> recode the sqlite layer of DDBI enough to make it compile without
>> incident.  Now it no longer has any prepared statement functionality, but
>> I supposed I can't have everything...
> 
> PreparedStatement for Sqlite wasn't working in the first place, which is why
> it was removed, but I'd love your patch for what you did. As for DDBI in
> general, I've put up a message on the DDBI pages noting what the current
> status/plan is.

Absolutely.  I've also begun a rather half-hearted effort to write a 
PreparedStatement for Sqlite, though I have no idea where it's going. 
I'll just leave that off...  All of Sqlite's issues were coming from 
SqliteDatabase.d:

Add "private import Integer=tango.text.convert.Integer;"

And then comment out from line 271 at revision 91:

IPreparedStatement createStatement(char[] statement)
{
	....
}

I would just give you a proper patch file, but I've got some unfinished 
work on a real SqlitePreparedStatement that isn't finished yet that I 
don't want muddying up the place.

I also found it useful to add "pragma (msg, "building against sqlite");" 
  below line 7 so that you can know it it's actively building against 
Sqlite.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 258 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20080607/3ef5d9e6/attachment.pgp>


More information about the Digitalmars-d mailing list