Improve JSON documentation

Issue #3565 duplicate
Thijs Damsma created an issue

I am having difficulty using sqlalchemy to setup queries for JSON fields, specifically the issue I mentioned in the following stack-overflow question

Of course this is also a not so subtle attempt to draw some attention to my question, but more in general I found the documentation for using JSON/JSONB and sqlalchemy very limited. It would be of great help if there were some more examples for doing less trivial querying and manipulation

Thanks!

Comments (3)

  1. Mike Bayer repo owner

    This seems like more of a request for Postgresql/JSON speciifc recipes using PG's special JSON functions. We dont have any specific support for these functions and #2450 indicates better support for some of these result types.

    We're getting a lot of these fairly vague "improve docs for X" requests lately but I don't see any action to take here. func.FOO() is documented, how to select from func.FOO() as a FROM is documented (see http://docs.sqlalchemy.org/en/rel_1_0/core/tutorial.html#functions), but note that we aren't very good at PG's functions yet so once #2450 is done we'd have better docs for PG's functions overall.

  2. Mike Bayer repo owner

    take a look at the jsonb_each recipe at https://bitbucket.org/zzzeek/sqlalchemy/issues/3555/extract-a-records-field#comment-22608043 I made for someone. Selecting from these PG functions is roughly possible with SQLAlchemy but it isn't built in right now and requires building custom function and expression objects, and a comprehensive out-of-the-box solution does not exist right now. it needs to be implemented, which itself requires a very thorough survey of everything needed and that is a big job.

  3. Log in to comment