TheDataShed / sql-deployment-tools

GNU General Public License v3.0
2 stars 0 forks source link

Validation Rule for `notification_email_address` #21

Open gvee-uk opened 2 years ago

gvee-uk commented 2 years ago

notification_email_address is a bit of a weird one.

The value is never sanity checked by SQL Server when used, and it silently truncates it to a maximum of 100 characters, leading to some unwanted side effects such as malformed email address(es)!

Technically speaking this can use a semi-colon delimited list of addresses, so long as the total length is less than 100 characters. However it is more commonly used for a single email address value (hence the name being a singleton).

As a minimum I want it to be validated such that:

Nice to haves:

gvee-uk commented 2 years ago

If we move to pydqntic the length check should be easily achievable using constr which has min_length and max_length options.