[PD-dev] Connecting up an SQL Database to PD

Andy Farnell padawan12 at obiwannabe.co.uk
Tue Nov 6 23:54:21 CET 2007


On Mon, 5 Nov 2007 23:33:42 +0100
Tim Boykett <tim at 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

-- 
Use the source




More information about the Pd-dev mailing list