3 ms·
Being able to validate SQL at code review time is really nice. Seeing the diff in GitHub between old vs new SQL can very quickly tip you off to troubles. Having
by bob1029 6y ago
Being able to validate SQL at code review time is really nice. Seeing the diff in GitHub between old vs new SQL can very quickly tip you off to troubles. Having your DB logic locked up in EF makes this kind of thing a lot more opaque. You could hypothetically develop a code review policy where developers are required to attach a query plan for each modified SQL statement to the PR.
If the biggest problem is whitespace/casing in your SQL, you are probably sitting in a really good position. This is something we do try to be strict about. All of our SQL lives as string constants in 1 file per database so it is really easy to keep track of what is being used throughout in a consistent way. We do not permit developers to write SQL strings outside of these files. It all has to be in 1 place. We have 1 file for all SQL commands that will ever be used against that database, and a 2nd file for its schema migration scripts.