On Mon, 5 Nov 2007 23:33:42 +0100 Tim Boykett tim@timesup.org wrote:
One of the important things about a database is that it can be accessed by several processes. One process can be dumping data into it from somewhere, another can retrieve that data and use it for something in real time or later or whatever. So I would prefer to have an interface to an external database.
A nice general model might be the way Perls Class::DBI (or even tie) work, as object serialisers with templates like flatfile, SQL, XML to load for whatever data backend you want.
I think its a great idea and will make many possibilities.
As for how to use it?
[textfile] has a simple buffer you can fill up with <cr> delimited lines. Keep it simple with an insert cursor from either side, and a send message that does any handle opening and dispatches or reads the data. The query should be completely left to the user to do with messages and depend on the template loaded.
It would be nice to easily dump and load multiple arrays to a database for wavetables, so don't ignore binary data blobs or even the idea of an audio rate [stream2db~].
I like the two object model, it fits with other Pd object patterns.
Maybe think about locking/contention for multiple connection objects, only one usable read write pair would be annoying.
MySQLite might be a good choice to go for first.
2c