I would have expected the SQLite dialect to know how to compile concat
to ||if that's the operator. But failing that, something more explicit
like this
ought to do the trick:

from sqlalchemy.sql import literal_column
literal_column("'+ '").op('||')(seconds.c.n).op('||')(literal_column("'
seconds'"))

Gulli



On Thu, Aug 29, 2013 at 12:33 PM, Greg Yang <[email protected]> wrote:

> I'm trying to get a series of datetimes using func.datetime. The format of
> input is func.datetime(basetime, '+ NNN seconds'), which works nicely if
> the shift applied is constant. However I need to add 10, 20, 30 seconds,
> etc to this base time. So I want something like func.datetime(basetime,
> concat('+', seconds.c.n, ' seconds')), but concat doesn't work for sqlite,
> which concatenates using the '||' operator. Is there working method to
> concat in sqlite?
>
> Failing that, is there another way to get at what I want with datetime
> arithmetics?
>
> --
> You received this message because you are subscribed to the Google Groups
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to