On Thu, Mar 1, 2012 at 12:11 PM, A.M. <age...@themactionfaction.com> wrote:
> Well, the SQL standard points at WITH RECURSIVE which is more general anyway. 
> W.R. is basically an inductive query loop construct (base case UNION 
> induction step) where CONNECT BY only handles key-based tree retrieval, no?
>
> Also, basic WITH support (without RECURSIVE) would be much appreciated- that 
> could offer more flexibility than FROM-subqueries and could open the door for 
> W.R.

Also, CTE support (recursive or not) would be easily implementable by
a special case of selectable, whose visitor only outputs the name, and
prepends to the string the "WITH blah AS bleh".


import sqlalchemy as sa
somestuff = sa.select(...).cte("somestuff")
somequery = sa.select( somestuff.c.somecolumn, somestuff.c.someval == 3)

Just to give an example.

I think this form makes a lot more sense in the SQLA API than the
context manager. This form can be joined and operated on like any
other table, and it could even be recursive if proper care is taken
and generative API is used:

somestuff = sa.select(...).cte("somestuff")
somestuff.append_from(somestuff.recurse)
somestuff.append_whereclause(somestuff.c.id == somestuff.recurse.c.parent_id)

Just a possibility.

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

Reply via email to