Stored procedures

Dec 6, 2012 at 2:51 PM

I'm now integrating with an existing database which has some stored procedures which I must use.

It would be nice if I could add a sproc to effort and test this.

However, I rather thing this is a bit outside the scope of Effort unless the implementation has a SQL database underneath it.

But just in case ... :)

Dec 6, 2012 at 3:39 PM
Edited Dec 6, 2012 at 3:40 PM

For now if I wanted to use stored procedures in integration tests, I would create an abstraction layer (interface). It would have two implementations:

  • Direct call to the appropriate stored procedure
  • Stored procedure logic reimplemented purely with Entity Framework

In integration tests, you could simply use the later implementation to avoid the need of a database. This approach satisfies my needs because I primarily use store procedures to implement simple logic that cannot be done efficiently with EF (e.g. recursive queries). For complex procedures maybe this approach is not appropriate.

Adding SQL text parsing support is absolutely non-trival, even if I would only care about SQL Server. So unfortunatelly I cannot promise any progress in this area.