Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Querying DB Views using Ormar #970

Open
idrissbellil opened this issue Dec 26, 2022 · 0 comments
Open

Querying DB Views using Ormar #970

idrissbellil opened this issue Dec 26, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@idrissbellil
Copy link

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.

@idrissbellil idrissbellil added the enhancement New feature or request label Dec 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant