So an example of what I'm thinking is:

http://github.com/knaveofdiamonds/sequel_fast_columns/blob/master/lib/sequel/fast_columns.rb

This is a gem that people can install and use (sequel_fast_columns).
Tests could use a little work in some areas.

Reasons why this approach won't work gratefully received.

Thanks,
Roland

On Sep 17, 9:50 am, Roland Swingler <[email protected]> wrote:
> > Is there a reason you are calling columns
> > before the query?  If you can call it after running the query, the
> > columns will already be filled in, and won't require an additional
> > database query.
>
> I'm calling columns first because I'm dynamically building queries and
> building html/csv from them, and in the output table the column
> headings come before the tbody. Some of the result sets are quite
> large, so I want to use #each rather than #all to output the rows,
> because I don't want to be loading the whole dataset in memory before
> starting to generate the output. I could possibly output the headings
> afterwards, and then do something downstream to re-arrange the output,
> but it seems cleaner to me to fix the issue I'm having at source. Like
> I say, I'll post something ready for general consumption soon (it
> could be that it might be better as an extension rather than part of
> the adapter though).
>
> Cheers,
> Roland

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

Reply via email to