Hallo, Mike McGonagle hat gesagt: // Mike McGonagle wrote:
I was just thinking, should the result sets be returned as TAGGED data? Meaning, should the name of the column precede the data in the returned PD list? While I can see that this would be useful, it would also require more processing to merge the keys with the data. I have so far been assuming that it is only the data that gets returned.
If it's a determinisic object, I'd say you can omit the tags. If a user wants tags, she can use "select id from table" or so to get her own id-tags in the results. it would be useful to have a second outlet [textfile]-style to signal the end of results.
Generally I prefer working with databases using ORMs like sqlobject.org instead of with SQL queries directly, but I don't know how a good and simple way to design something like an SQL-ORM for Pd could look like.
Another thing that may be important in the long run would be a common interface for all DB adapters. So the Pd object for sqlite shouldn't behave too differenty from the objects for postgresql, mysql, etc. Again that's something I like about Pythons SQLObject (or other ORMs like SQLAlchemy ...): They provide an abstract interface to lots of backends. Probably something like this exists for C/C++ as well, you may want to g**gle for it. (Oh, and maybe prototyping and testing such a general purpose SQL class for Pd is easier in Lua or Python, but I think I already mentioned that. ;)
Ciao