Also, Jamie, if you are sending back an entire result set as a list, what would be the point of having the second outlet indicating the end of the data? It would bang pretty much at the same time as the output list would come out.
Mike
On 11/13/07, Mike McGonagle mjmogo@gmail.com wrote:
On 11/13/07, Mike McGonagle mjmogo@gmail.com wrote:
So, then, if you are just taking ALL the result sets as one big row, just how do you split the list up into individual pieces? Seems to me there is a lot of need to add a lot of processing code to the PD patch.
Maybe we should take a poll on this, as from what I have done with other databases things was to process each row individually.
The idea of using "limit/offset" to get specific things from a database kind of defeats the purpose of doing ONE query to get all the data. That just requires making MANY more queries on the database.
Mike
On 11/13/07, jamie@postlude.co.uk jamie@postlude.co.uk wrote:
Frank Barknecht wrote:
Jamie Bullock hat gesagt: // Jamie Bullock wrote:
I would think that making it such that it acted like 'textfile', that with each bang sent to the sql object, that it would return each subsequent row, and once the end of that set is reached, it would output a bang on a second outlet, similar to what 'textfile' does.
Good idea! I'll add that too.
Actually I thought about this, too, but I'm not sure if it's really useful. One of the strengths of SQL is, that you can limit the result set manually. So if I'd want one row at a time, I'd design my SQL query as such using LIMIT, and if I want more rows, I'd just use a different LIMIT clause. Hardcoding this into the SQL class in my view doesn't make much sense. (Using the last outlet to signal the end of results like in [textfile] does make sense, though.)
I agree. When I said "I'll add that too", I actually meant the 'bang on end of results from each query' functionality, not the 'output one line as list' a la [textfile]. If people want that, they can just do:
[psql] | [list prepend add] | [textfile]
...and then take advantage of the wonderful facilities offered by [textfile]!
Jamie
PD-dev mailing list PD-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
-- Help the Environment, Plant a Bush back in Texas!
"I place economy among the first and most important republican virtues, and public debt as the greatest of the dangers to be feared. To preserve our independence, we must not let our rulers load us with perpetual debt." -- Thomas Jefferson, third US president, architect and author (1743-1826)
"Give Peace a Chance" -- John Lennon (9 October 1940 – 8 December 1980)
Peace may sound simple—one beautiful word— but it requires everything we have, every quality, every strength, every dream, every high ideal. —Yehudi Menuhin (1916–1999), musician
If you think you can, or you think you can't, you are probably right. —Mark Twain
"Art may imitate life, but life imitates TV." Ani DiFranco
-- Help the Environment, Plant a Bush back in Texas!
"I place economy among the first and most important republican virtues, and public debt as the greatest of the dangers to be feared. To preserve our independence, we must not let our rulers load us with perpetual debt." -- Thomas Jefferson, third US president, architect and author (1743-1826)
"Give Peace a Chance" -- John Lennon (9 October 1940 – 8 December 1980)
Peace may sound simple—one beautiful word— but it requires everything we have, every quality, every strength, every dream, every high ideal. —Yehudi Menuhin (1916–1999), musician
If you think you can, or you think you can't, you are probably right. —Mark Twain
"Art may imitate life, but life imitates TV." Ani DiFranco