public inbox for [email protected]  
help / color / mirror / Atom feed
From: Daniele Varrazzo <[email protected]>
To: [email protected]
Subject: A Django backend for PostgreSQL using Psycopg 3
Date: Mon, 2 Aug 2021 09:59:19 +0200
Message-ID: <CA+mi_8Y+Q=VG4TdzNgWRA8C0+wcFVWQeKaEBqzjCNu6h78565w@mail.gmail.com> (raw)

Hello,

I have implemented a backend to enable Django to use PostgreSQL using Psycopg 3.

The backend is currently implemented as an external module [1]
requiring a few modifications to Django [2] to successfully run the
whole Django test suite. Most of the changes are import-related
(breaking the assumption that "psycopg2" is always present if you are
talking to PostgreSQL); a few changes are more interesting, because
they show the difference in the database behaviour moving from
client-side to server-side parameters passing. I have written an
article explaining the changes needed [3] which you might find useful.

[1] https://github.com/dvarrazzo/django-psycopg3-backend
[2] https://github.com/django/django/compare/stable/3.2.x...dvarrazzo:psycopg3-support
[3] https://www.psycopg.org/articles/2021/08/02/psycopg3-django-driver/

The next step, on this front, will be to liaise with the Django
project and understand if there is interest in accepting the changes
(I hope so) and whether the changes need to be adapted to better suit
the Django project. On the Psycopg 3 front, I would say that
supporting the whole Django test suite is a good maturity test of
which I am very happy. I am completing a final review looking for
missing bits (verifying that the tests in the psycopg2 test suite have
an equivalent in Psycopg 3), after which we can release a package with
hopefully the definitive adapter interface.

Thank you very much for your support. I hope that this work will be
useful for everyone.

-- Daniele





reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: A Django backend for PostgreSQL using Psycopg 3
  In-Reply-To: <CA+mi_8Y+Q=VG4TdzNgWRA8C0+wcFVWQeKaEBqzjCNu6h78565w@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox