tortoise / tortoise-orm

Familiar asyncio ORM for python, built with relations in mind
https://tortoise.github.io
Apache License 2.0
4.38k stars 356 forks source link

Add support for composite primary keys and foreign keys #1567

Open csirmazbendeguz opened 3 months ago

csirmazbendeguz commented 3 months ago

Is your feature request related to a problem? Please describe. When it comes to database partitioning and sharding, composite primary keys are often recommended.

Describe the solution you'd like A solution to define composite primary keys on the model, and foreign keys capable of referring to composite primary keys.

Describe alternatives you've considered It's always possible to work around the ORM, but it's inconvenient, especially when building a system with a lot of tables.