]> git.ipfire.org Git - thirdparty/psycopg.git/commit
feat: allow binary JSON dumps
authorLionel Panhaleux <lionel.panhaleux@gmail.com>
Fri, 19 May 2023 12:03:29 +0000 (14:03 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sun, 4 Jun 2023 22:33:35 +0000 (00:33 +0200)
commit075439976abd9e4f02d18adf7cb2685fbed0118e
tree7d464a8b42e3a6da89ae1242fe9167534aaa17db
parent3d33ad437294adc8d675564108ba2dd358860968
feat: allow binary JSON dumps

Some JSON libraries, in particular the widespread
[orjson](https://github.com/ijl/orjson#quickstart) library, directly
dump data in binary format.

This change allows it and avoids having to decode/encode in these cases
by testing the return type of the `dumps` function.
docs/news.rst
psycopg/psycopg/types/json.py
tests/types/test_json.py