Introducing Dragonfly Database Interface

Started by itistoday, December 08, 2009, 04:32:45 PM

Previous topic - Next topic

itistoday

http://www.taoeffect.com/blog/2009/12/introducing-objective-newlisp/">Objective newLISP was, in fact, originally created for this purpose:



http://www.taoeffect.com/newlisp/database.lsp.html">DF.DB - A Generic Database Interface for Dragonfly and newLISP



The first subclass has already been http://www.taoeffect.com/newlisp/database_sqlite3.lsp.html">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!
Get your Objective newLISP groove on.

itistoday

#1
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 http://www.taoeffect.com/newlisp/database.lsp.html">the docs for more info.
Get your Objective newLISP groove on.

m35

#2
Have you considered using an existing library that takes care of abstracting databases? I haven't looked very thoroughly, but it seems http://www.linuxnetworks.de/doc/index.php/OpenDBX">OpenDBX might do the job.

itistoday

#3
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 http://www.linuxnetworks.de/doc/index.php/OpenDBX">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!
Get your Objective newLISP groove on.

itistoday

#4
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.
Get your Objective newLISP groove on.