* it is easily unit tested
* all source code is one place that can be branched, versioned, merged, deployed, rolled back, diffed, code reviewed, approved with pull request etc.
* it is easily unit tested
* all source code is one place that can be branched, versioned, merged, deployed, rolled back, diffed, code reviewed, approved with pull request etc.
In which case the stored procedures are in your "main" code repo and "deploying" them simply means running the software. Though your point about unit tests stands.
Table schema is the hard part since there is overhead associated with creating an index on an existing table and with renaming a column.
How do you handle 5 - 10 devs working concurrently if they are all running tests?
pgtap lets us unit test our SQL functions, triggers, views, etc. It's integrated with our change management system. It's fast enough and works well.
You can run unit tests by creating transactions, running the test, and then rolling back at the end.
I do get your point, though. It's more convenient to be able to mock your database from your code.
https://msdn.microsoft.com/en-us/library/dn314429(v=vs.113)....
Go down to "Testing Query Scenerios". I've wrapped the four "mockset.As" lines into one extension method to make it a lot less verbose.
context.Database.Log = log.Info
Where Log.info is just a method that accepts a string and take a look at the log file generated from your unit tests.