On Sat, May 11, 2013 at 6:37 AM, Michael Bayer <mike...@zzzcomputing.com>wrote:

> Building a custom FROM clause though, a little tricky.   Feel free to send
> along a whole working example.


Ok, thanks for the info. The Pivot example is something I've been working
on at work, so I can't send that one along. But I've got a few more to do
that I haven't started yet (silly copyright stuff) so maybe I'll give
another one of those a try this weekend and see if I can figure it out (if
you don't mind me sending a few more questions along in the process).

One question I had right away is the sequence of events between actually
querying the database and building the Columns for .c etc. I think I'm
going to try to implement UNPIVOT since it's fairly related and shouldn't
give me work issues.
http://archive.msdn.microsoft.com/SQLExamples/Wiki/View.aspx?title=UNPIVOTData


So I'm going to have something like

class Unpivot(FromClause):
  def __init__(self):
    self. (blah blah... set all of my parameters)
  def _populate_column_collection(self):
    # Make list of Columns, each one being _make_proxy(name)?

@compiles(Unpivot)
def compile(element, compiler, **kw):
  # Generate the actual SQL expression

Is there anything that needs to be done to actually tie those things
together so that the query actually gets run when I use Unpivot or is that
somehow "automagic?"

Thanks for pointing me in the right direction,
Dan

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to