Search code examples
pythondjangodjango-database

Django database backend documentation


I want to adapt an existing db backend to a custom db engine that we are using.

Is there any document or whitepaper that explains the design of django database backends?

I've been searching through djangoproject and checked this question how to write a custom django relational database backend without any luck


Solution

  • There is some Info about how to customize django backends, but it is pretty much work depending on which DB engine you want to use.

    Anyhow:

    https://reinout.vanrees.org/weblog/2016/11/04/database-backends.html https://simpleisbetterthancomplex.com/media/2016/11/db.pdf

    Doc for 3rd party engines:

    https://docs.djangoproject.com/en/2.0/ref/databases/#using-a-3rd-party-database-backend

    It is pretty much straight forward, you can either adapt an existing backend (like the answer you reffered to suggests) or use them as an example for your own backend.

    But I have to say it depends very much on the engine you want to use, I wanted to do this for pyrqlite but gave up on it since most ways where impossible and all others implied a hell load of work...

    I suggest you go that way only if you really need to.