On Jun 13, 2006, at 4:03 AM, Lele Gaifax wrote:
>
> Wouldn't something like
>
> diary = FunctTable('diary(:iddip,:fromdate,:todate,:live)', ...)
>
> be a viable solution to the problem as well as a nicer approach to
> ticket #172, if at all possible?
>
yes this is why I put all those notes of "i want to think about this"
at the bottom of ticket 172. because a Function right now is treated
as a column-based object, not a "fromclause" type of object. I need
to consider if it really is just a "fromclause" object which when
used in a column clause is the same as an embedded select, or if in
fact the Function needs to implement both interfaces (this would be
done via two separate objects, not multiple inheritance, however the
outside world would still just deal with "func").
if the Function is then really a "fromclause" object, what columns
does it export ? without trying anything, i am leaning towards just
"*" as the most general answer....but that might also present
problems with joins etc.
it may be the case that we have to do something like what youre
talking about, i.e. a Function that has explicit columns and all.
maybe just making a totally new object would be better, it would have
to include information about the parameters and its result columns
(this one has different types for the parameters and the result
columns):
f = Function('diary',
Parameter('iddip', Integer),
Parameter('fromdate', Date),
Parameter('todate', Date),
Parameter('live', Boolean),
Column('result_col', String),
Column('result_date', Date)
)
f(5,datetime(5,2,2006), datetime(5,5,2006), True).select()
what do you think ? this would actually be a schema object.
_______________________________________________
Sqlalchemy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users