Page 1 of 1

Introducing Dragonfly Database Interface

Posted: Wed Dec 09, 2009 12:32 am
by itistoday
Objective newLISP was, in fact, originally created for this purpose:

DF.DB - A Generic Database Interface for Dragonfly and newLISP

The first subclass has already been created for Sqlite3.

These will be in the next release of Dragonfly, but if anyone is interested I'm looking for people who help implement this interface for all the other major databases, starting with MySQL and PostgreSQL!

Re: Introducing Dragonfly Database Interface

Posted: Wed Dec 09, 2009 5:01 am
by itistoday
I've updated the interface and Sqlite3 to 1.1 with one more class: DF.BLOB.

DF.BLOB allows for efficient and intuitive storage and retrieval of BLOB datatypes (binary data). See the docs for more info.

Re: Introducing Dragonfly Database Interface

Posted: Wed Dec 09, 2009 5:06 pm
by m35
Have you considered using an existing library that takes care of abstracting databases? I haven't looked very thoroughly, but it seems OpenDBX might do the job.

Re: Introducing Dragonfly Database Interface

Posted: Wed Dec 09, 2009 8:52 pm
by itistoday
m35 wrote:Have you considered using an existing library that takes care of abstracting databases? I haven't looked very thoroughly, but it seems OpenDBX might do the job.
No, I did not, so thanks for pointing that out to me!

OpenDBX looks very nice indeed, thanks very much for pointing it out! If it's as good as it looks I will make a DF.DB subclass for it, in which case there won't be a need for any other subclasses it seems! :-)

Thankfully even in light of this news the Sqlite3 subclass still wasn't a waste of time for these reasons:

1) It's probably a little faster because it's not a wrapper to a wrapper.
2) It was necessary to implement to get a good idea of how the DF.DB interface should look like anyway.
3) It lets people use Sqlite3 with newLISP in a powerful way without having to install OpenDBX.
4) I wanted to learn the sqlite3 API. :-)

So that makes me feel a bit better, but very lucky that you pointed this out to me before I started implementing OpenDBX itself in newLISP. :-p

BTW, if anyone can recommend any similar libraries to OpenDBX please let me know!

Re: Introducing Dragonfly Database Interface

Posted: Fri Dec 18, 2009 1:02 am
by itistoday
I updated the Sqlite3 subclass to 1.1.1 to fix a bug related to binding integers with a 32-bit newlisp (on certain machines), also improved readability of logged errors.