- changed status to resolved
improve scalar=True subqueries
Issue #681
resolved
cant do operations on a subquery:
select([foo](foo), scalar=True) - bindparam('bar').label('hoho')
you have to turn the select into a full ColumnElement
:
select([foo](foo), scalar=True).label('foo') - bindparam('bar').label('hoho')
I think perhaps we should, in 0.4, change "scalar=True" to just select(..).scalar(), which returns a ColumnElement wrapper for the select...and deprecate scalar=True. that will clear up the messsiness between scalar/non-scalar selects.
Comments (2)
-
reporter -
reporter - removed milestone
Removing milestone: 0.4.0 (automated comment)
- Log in to comment
went with
as_scalar()
. main work in changeset:3031, changed the name toas_scalar()
in changeset:3033 to avoid clashes with existingscalar()
method.