Certain properties on the structs/models need to be checked for uniqueness (names, MAC addresses, etc.). This is currently handled by the database through unique constraints: https://github.com/evanebb/gobble/blob/main/configs/schema.sql
This should be built into the code for the following reasons:
- Relying on the database to do uniqueness checks means that it has too much responsibility, and it should only be there as a last resort.
- It allows me to have neater/clearer error messages, since the errors returned by the database can be confusing and expose too much information about the underlying system.
Certain properties on the structs/models need to be checked for uniqueness (names, MAC addresses, etc.). This is currently handled by the database through unique constraints: https://github.com/evanebb/gobble/blob/main/configs/schema.sql
This should be built into the code for the following reasons: