zzzeek / test_sqlalchemy

0 stars 0 forks source link

support AS with derived column list #1004

Closed sqlalchemy-bot closed 12 years ago

sqlalchemy-bot commented 16 years ago

Issue created by jek (jek)


in SQL,

#!sql

SELECT * FROM tbl AS alias(colalias1, colalias2, colalias2)
-- or, more practically
SELECT * FROM tblfunction(123) AS res(cola, colb, colc)

SELECT * FROM (VALUES (1,'a'), (2, 'b')) AS t (num, alpha)
-- unspecified columns are returned but retain their original
-- name (possibly anonymous)
SELECT * FROM (VALUES (1,'a'), (2, 'b')) AS t (num)
sqlalchemy-bot commented 12 years ago

Michael Bayer (zzzeek) wrote:


having trouble seeing the win in terms of SQLA column metadata, as we don't use names to identify things, would this look like:

#!python

sometable.alias('somealias', {sometable.c.a:'p', sometable.c.b:'q', sometable.c.c:'r'})

I'm not really seeing how that's very useful, as you'd use column objects and not strings to identify in a result set.

For VALUES, that's not a builtin, there's a recipe at UsageRecipes/PGValues that can be adapted to name the columns in a certain way.

I'd like to see more detail on how this would look, but at the moment I don't see any movement happening here so closing this for now.

sqlalchemy-bot commented 15 years ago

Michael Bayer (zzzeek) wrote:


sqlalchemy-bot commented 12 years ago

Changes by Michael Bayer (zzzeek): set state to "wontfix"

sqlalchemy-bot commented 15 years ago

Changes by Michael Bayer (zzzeek): changed priority from "major" to "minor"; set milestone to "0.5.xx"

sqlalchemy-bot commented 9 years ago

Changes by Michael Bayer (zzzeek): changed milestone from "0.x.xx" to "1.x.xx"