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

4
  • 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. Commented Apr 27, 2016 at 22:33
  • yeah thanks, that's the route I'm following Commented Apr 30, 2016 at 8:50
  • Did you write your django db backend? Any notes you'd share, best examples, what helped most/least? Commented May 19, 2018 at 4:19
  • 1
    I gave a talk at PyConEs last year about this: pycones19.sched.com/event/VdO8 -> youtube.com/… Commented May 6, 2020 at 11:24

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.