jazzband / dj-database-url

Use Database URLs in your Django Application.
https://pypi.org/project/dj-database-url/
BSD 3-Clause "New" or "Revised" License
1.49k stars 205 forks source link

Supporting server_side_binding in “OPTIONS” With psycopg 3.1.8+ #234

Closed truongvan closed 11 months ago

truongvan commented 11 months ago

Django 4.2 introduces a new feature for psycopg 3.1.8 and later versions, supporting server_side_binding. Handling the Boolean type specifically is necessary, as Django evaluates the condition using options.get("server_side_binding") is True. Therefore, the query parameters should be formatted as follows: postgres://USER:PASSWORD@HOST:PORT/NAME?server_side_binding=true.