Re: [Sqlalchemy-tickets] [sqlalchemy] #1068: render 'SELECT foo() AS x .. ORDER BY x' by default
Brought to you by:
zzzeek
From: sqlalchemy <mi...@zz...> - 2008-06-01 01:17:09
|
#1068: render 'SELECT foo() AS x .. ORDER BY x' by default --------------------------------+------------------------------------------- Reporter: jek | Owner: zzzeek Type: enhancement | Status: new Priority: high | Milestone: 0.5.0 Component: sql | Severity: no triage selected yet Resolution: | Keywords: Status_field: awaiting triage | --------------------------------+------------------------------------------- Comment (by zzzeek): OK the "string" use case is probably not going to fly, since we have this general contract that select().call_something('some string') is going to just interpret the string as a text() clause. There's just as much chance that someone says `order_by("CASE when x1>x2 THEN 2 ELSE 0")` as they would say `order_by('label1')`. It would get out of hand to say that `where()`, `order_by()`, `column()` etc. are all going to have wildly different ideas of what a "string" means. So yeah having `c1 = func.foo().label('c1')` just render as the label in all cases except columns clause and overriding dialects is not a terribly big deal. Involves some different semantics regarding the `render_labels` argument to `visit_label()`, probably including a name change. still would be good at 0.5.0 to establish the new pattern. -- Ticket URL: <http://www.sqlalchemy.org/trac/ticket/1068#comment:3> sqlalchemy <http://www.sqlalchemy.org/> The Database Toolkit for Python |