3

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

Community
  • 1
  • 1
tato
  • 5,439
  • 4
  • 31
  • 27
  • Maybe someone answers but I doubt there is any documentation, writing db backends is not something many people need to do. I would just take existing backend implementation as a template and try to modify it. There is also a bunch of third party db backends, can check those as well maybe they are more similar to your db. – serg Apr 27 '16 at 22:33
  • yeah thanks, that's the route I'm following – tato Apr 30 '16 at 08:50
  • Did you write your django db backend? Any notes you'd share, best examples, what helped most/least? – JimB May 19 '18 at 04:19
  • 1
    I gave a talk at PyConEs last year about this: https://pycones19.sched.com/event/VdO8 -> https://www.youtube.com/watch?v=fvg7FLA_69k&list=PLahUDl6AAwrg-8TJGzwz1BMT2W-wWIk1F&index=15&t=0s – tato May 06 '20 at 11:24

1 Answers1

1

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.

nyx00
  • 106
  • 3
  • 12