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!
Introducing Dragonfly Database Interface
Introducing Dragonfly Database Interface
Get your Objective newLISP groove on.
Re: Introducing Dragonfly Database Interface
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.
DF.BLOB allows for efficient and intuitive storage and retrieval of BLOB datatypes (binary data). See the docs for more info.
Get your Objective newLISP groove on.
Re: Introducing Dragonfly Database Interface
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
No, I did not, so thanks for pointing that out to me!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.
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.
Re: Introducing Dragonfly Database Interface
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.