mikehadlow/EasyNetQ — pull request #147 by jeffdoolittle (2014-01-18 09:44:02+00:00)
Title: Postgres scheduler

I did not take a direct dependency on the Npgsql postgres .NET data library. Instead, as you can see, I modified the SchedulerRepository to make it entirely abstract and database agnostic. I'm using DbProviderFactories instead of specifically referencing anything in the System.Data.SqlClient namespace. Incidentally, I learned how to do this from the massive micro-orm project created by @robconery (https://github.com/robconery/massive).

I wanted to keep MSSQL conventions for the MSSQL stored procs, and I wanted to also follow more standard postgres naming conventions for the postgres functions. To facilitate this, you'll see there is a new ISqlDialect interface that allows for the selection of appropriate stored procedure / function names and parameter names based on the specified database provider (which is specified using the standard connectionString key in app.config). This idea was borrowed from the NEventStore project (https://github.com/NEventStore/NEventStore/tree/master/src/NEventStore/Persistence/Sql).

I've tested both the MSSQL and postgres implementations quite thoroughly and I'm excited to add open source database support to this project. Also, these changes set a good foundation for the implementation of dialects for other RDBMSs to serve as the scheduler database store.

Cheers,

--Jeff