joereynolds / sql-lint

An SQL linter
MIT License
438 stars 40 forks source link

Check: Invalid date format #88

Open joereynolds opened 5 years ago

joereynolds commented 5 years ago

On columns that specify a datetime or date, warn of an invalid date. We should also do this on date and time functions,

Sample output:

Invalid date '45/67/2018' specified for column 'purchase_date'
Invalid date '45/67/2018' given for call to 'DATEDIFF'

See the list here: https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html

Note the {driver} part of the path. This can be any valid driver supported by sql-lint, for now, just do mysql.

joereynolds commented 5 years ago

https://github.com/joereynolds/sql-lint/commit/338c95c85b9f620a77423805e0be07a8aad0f9ba