On Feb 18, 2010, at 6:02 AM, Manlio Perillo wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Michael Bayer ha scritto:
>> On Feb 17, 2010, at 9:56 AM, Manlio Perillo wrote:
>> 
>> Michael Bayer ha scritto:
>>>>> [...]
>>>>> By the way, I have found an incorrect behaviour in SQLAlchemy, when the
>>>>> select column list is empty.
>>>>> 
>>>>> query = sql.select(
>>>>> None, contents.c.slug == 'python', from_obj=[join])
>>>>> 
>>>>> 
>>>>> SQLAlchemy generates an incorrect SQL query.
>>>>> It should, instead, automatically add the columns from the `from_obj`
>>>>> list, skipping duplicate columns involved in a join.
>>>>> 
>>>>>> sounds more like an assumption to me.
>>>>>> select(None) is specifically a select with no columns,
>>>>>> which can be added later using column() (that might be the intent).
>> Of course.
>> The columns should be added when the SQL query is generated.
>> 
>>> yeah that's not how it works.   the columns are added to the structure.   
>>> statement compilation doesn't make huge guesses like that.
>> 
> 
> Ok.
> My idea was to implement the equivalent of SQL '*' column.
> I can't use the literal '*' in the select column list, since it will
> disable (?) SQLAlchemy type system.
> And I don't want to manually add the columns, since I will end up with
> duplicate columns.

that's a better idea.   how about sqlalchemy.EXPAND_STAR ?



> 
> 
> 
> Manlio
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> 
> iEYEARECAAYFAkt9Hi0ACgkQscQJ24LbaURw+ACcDmBfcJTZyJJtn3w7Iw02tUY6
> bZAAnAr+m0GNB2pwn/uQFxjHibvaTGpB
> =9462
> -----END PGP SIGNATURE-----
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To post to this group, send email to sqlalch...@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.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@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