Fork me on GitHub

if i have a user table with a primary key set to auto-increment, but i want to check to make sure a new user doesn’t try to register with an existing email address, would i make a struct validator that calls a hug-sql function to look up to make sure no one has that email address, or is there some better way? what’s the idiomatic way? (also, props to anyone who has a recommendation for a package so i don’t have to manage things at this level)