[Server v3] Sort, cleanup and uniformise SQL queries #7122
Labels
A-Server
Area: Server application
I-Postgresql
Impact: Postgresql issue
refactor
Improve code, don't change behavior
A cleanup of the SQL queries could be useful, in particular:
Some queries are also duplicated in different component modules. Instead, one component should probably expose a method to be used by the other components.
Another improvement would be to replace all the occurrences of such pattern:
by:
At the moment both approaches are used, so it's a bit confusing to navigate between queries.
Another suggestion: internal ids for organization, user and device could be extracted during the checks common to all authenticated commands (see #7119 ). The same could also performed for the internal realm id for the realm commands. This would simplify a lot of SQL queries like the example above. There was already an attempt at implementing this here:
parsec-cloud/server/parsec/components/auth.py
Lines 46 to 67 in 11efa76
The text was updated successfully, but these errors were encountered: