Skip to content

Add uniqueness checks for identifying properties #3

@evanebb

Description

@evanebb

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions