3 ms·
Sending row IDs to your frontend has two potential problems: - Row IDs can be reused when the row is deleted. So when the frontend sends a message to the backe
by Hytak 2y ago
Sending row IDs to your frontend has two potential problems:
- Row IDs can be reused when the row is deleted. So when the frontend sends a message to the backend to modify that data, it might accidentally modify a different row that was created after the original was deleted.
- You may be leaking the total number of rows (this allows detecting when new rows are created etc. which can be problematic).
If you have nothing else to uniquely identify a row, then you can always create a random unique identifier and put a unique constraint on it.