On Thursday, May 12, 2016 at 9:26:26 AM UTC-7, Amir Tuval wrote: > > Hi, > > I'm looking for a way to list all columns used in a specific dataset. By > all columns, I mean not only the columns used in the select clause, but > also columns used in joins, where, group by, order by etc. > > Just to put into context, what I'm trying to achieve - > I have several aggregated tables, holding basically the same data, but > some or smaller than the other because they do not have all the aggregated > columns. > The smaller tables are faster to query, so I'd rather use them whenever > possible, and only use the bigger tables when their columns are queried. > > I'd like to abstract this away from the users, so that they can simply run > Sequel queries and not worry about which table to use - the abstraction > will select the most suitable table behind the scenes. >
For what you are doing, I would keep all of the metadata for the query outside of Sequel, and then when you are ready to execute the query, build the appropriate Sequel dataset and execute it. While you can build the Sequel dataset incrementally and then try to introspect the dataset to get the information you want, that's probably a more difficult approach. Thanks, Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sequel-talk. For more options, visit https://groups.google.com/d/optout.
