]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
-Fixed bug where Postgresql JSON type was not able to persist or
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 7 Aug 2014 14:43:55 +0000 (10:43 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 7 Aug 2014 14:43:55 +0000 (10:43 -0400)
commit3c6ff6adaec23d34f0a91a3889801589b10082e2
tree8fe5241834a672cf5d9c80bc6d0236b4883656b9
parentb35e6c69b726d445a2d51fc3433ff3f97a04ed38
-Fixed bug where Postgresql JSON type was not able to persist or
otherwise render a SQL NULL column value, rather than a JSON-encoded
``'null'``.  To support this case, changes are as follows:

* The value :func:`.null` can now be specified, which will always
  result in a NULL value resulting in the statement.

* A new parameter :paramref:`.JSON.none_as_null` is added, which
  when True indicates that the Python ``None`` value should be
  peristed as SQL NULL, rather than JSON-encoded ``'null'``.

Retrival of NULL as None is also repaired for DBAPIs other than
psycopg2, namely pg8000.

fixes #3159
doc/build/changelog/changelog_09.rst
lib/sqlalchemy/dialects/postgresql/json.py
test/dialect/postgresql/test_types.py