That is the case, I'm afraid. Thanks for the prompt reply and thanks for
making such a killer library. :-)

On Sat, Aug 22, 2015, 9:51 AM Mike Bayer <[email protected]> wrote:

> what's the SQL you want - is this the special Postgresql syntax where an
> entire table name is sent to a function?  SQLAlchemy doesn't support
> that.   Just use text(), if this is the case.
>
>
>
>
> On 8/21/15 11:44 PM, Tim Radke wrote:
>
> I'm using SQLAlchemy version 0.9.8, connecting to Postgres 9.4. I'm trying
> to do something like this:
>
> query = select([func.to_json(User)]).select_from(User)
>
> # Printing the query returns something that seems to make sense:
>
> # >>> print select([func.to_json(User)]).select_from(User)
>
> # SELECT to_json(:to_json_2) AS to_json_1
>
> # FROM users
>
> # But when I go to execute, I get:
> session.execute(query)
>
> # sqlalchemy.exc.ProgrammingError: (ProgrammingError) can't adapt type
> 'DeclarativeMeta' 'SELECT to_json(%(to_json_2)s) AS to_json_1 \nFROM users'
> {'to_json_2': <class 'monitoring.models.User'>}
>
> Obviously I'm doing something terribly wrong. Might someone be able to
> point me in the right direction? I haven't been able to find anything in
> the docs that addresses trying to do such a thing. Oh, I've also tried
> passing the model's Table object, but that seems to be even worse. It's as
> if the parameter wasn't ever passed.
>
> Thanks!
> --
>
> 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/d/optout.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "sqlalchemy" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/sqlalchemy/nSjb2efvyvY/unsubscribe.
> To unsubscribe from this group and all its topics, 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/d/optout.
>

-- 
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/d/optout.

Reply via email to