newLISP Fan Club

Forum => So, what can you actually DO with newLISP? => Dragonfly => Topic started by: itistoday on December 08, 2009, 04:32:45 PM

Title: Introducing Dragonfly Database Interface
Post by: itistoday on December 08, 2009, 04:32:45 PM
Objective newLISP (//http) was, in fact, originally created for this purpose:



DF.DB - A Generic Database Interface for Dragonfly and newLISP (//http)



The first subclass has already been created for Sqlite3 (//http).



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!
Title: Re: Introducing Dragonfly Database Interface
Post by: itistoday on December 08, 2009, 09:01:33 PM
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 (//http) for more info.
Title: Re: Introducing Dragonfly Database Interface
Post by: m35 on December 09, 2009, 09:06:20 AM
Have you considered using an existing library that takes care of abstracting databases? I haven't looked very thoroughly, but it seems OpenDBX (//http) might do the job.
Title: Re: Introducing Dragonfly Database Interface
Post by: itistoday on December 09, 2009, 12:52:35 PM
Quote from: "m35"Have you considered using an existing library that takes care of abstracting databases? I haven't looked very thoroughly, but it seems OpenDBX (//http) 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!
Title: Re: Introducing Dragonfly Database Interface
Post by: itistoday on December 17, 2009, 05:02:51 PM
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.