Best Practices Adding/Removing From DB

So bringing up a semi old topic here. I’m now going back and adding in some logic so people can’t accidently write the same snake name to different table records since I’m using snake name throughout my app.

Curious others thoughts here as I’m testing a few options for the best option but I’m thinking when someone adds a snake I would just pull their records and see if a snake with the same name in the row exists otherwise add it.

Or I guess I could use the row ID, I’m just curious how others have approached this as well as formatting since obviously its case sensitive so I’ve debating just making everything lowercase as I put it in. Wasn’t sure if someone with more experience with anvil that might have hit some of this and your opinions.

I’m testing a few things myself here but figured I’d put the feeler out there while I test this myself. I created a big bug here for myself by not doing form validation and now people are adding duplicate snakes doh :slight_smile: