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

Make readOnly requests to the database the default #1705

Closed
andchiind opened this issue Aug 2, 2024 · 1 comment
Closed

Make readOnly requests to the database the default #1705

andchiind opened this issue Aug 2, 2024 · 1 comment
Assignees
Labels
backend Backend related functionality improvement Improvement to existing functionality

Comments

@andchiind
Copy link
Contributor

Describe the improvement you would like to see
Instead of having to specify when a request is readOnly, forcing developers to specify when they want to be able to edit a database entry will result in better code quality and performance. This is straightforwards to enable (see https://learn.microsoft.com/en-us/ef/core/querying/tracking#no-tracking-queries), but will take more time to get working with the existing code. A good first step would be to go to the functions that have "bool readOnly = false" set as a parameter and change the default value to true instead.

How will this change existing functionality?
As mentioned this will encourage better code quality and readability. It will hopefully encourage developers to pay more attention to how objects are used in the functions they pass them to and perhaps consider simply passing the object ID or a readOnly object instead so that we do not need to follow the object throught the call stack to find inconsistencies when debugging.

How will this improvement affect the current Threat Model?
It will improve it by reducing accidental database changes.

@andchiind andchiind added backend Backend related functionality improvement Improvement to existing functionality labels Aug 2, 2024
@tsundvoll
Copy link
Contributor

Already merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Backend related functionality improvement Improvement to existing functionality
Projects
None yet
Development

No branches or pull requests

2 participants