Django ORM support for composite primary keys
- Mentors
- Lily Foote
- Organization
- Django Software Foundation
- Technologies
- python, mysql, postgresql, mariadb, sqlite, Oracle
- Topics
- Django ORM
In database design, composite primary keys are often necessary for the partitioning and sharding of database tables.
- Citus is a PostgreSQL extension that transforms PostgreSQL into a distributed database.
- django-multitenant is a library by Citus which enables developers to build multi-tenant applications in Django.
In Citus, composite primary keys are required. So, in order to use these tools with Django, the developers must work around the Django ORM.
To make building multi-tenant apps easier, I propose adding composite primary key support to the Django ORM.
https://gist.github.com/csirmazbendeguz/de1fdf88bf9df0dfba837f8e88c35df6