collerek/ormar

Querying DB Views using Ormar

Opened this issue · 0 comments

Is your feature request related to a problem? Please describe.
I have a complex DB view that relies on other views and would like to use Ormar to query data in that view. What worked partially is to create the model class and set the primary_key=True in one of the fields (although it's duplicated everywhere). I could fetch data but I was only receiving entries with unique primary_key.

Describe the solution you'd like
Allow model descriptions without primary_key

Describe alternatives you've considered
Receive entries in which the primary_key field is duplicated

Additional context
I considered bypassing the DB Views and use the original tables with ormar models, but it brought some additional complexity that I was trying to keep in the DB.