Skip to content

Latest commit

 

History

History
23 lines (14 loc) · 1.05 KB

readme.rdoc

File metadata and controls

23 lines (14 loc) · 1.05 KB

migratordotnet for Sqlite in-memory databases

I wanted to use an in memory database for query testing and wanted to use the same migrations as the production DB.

Migratordotnet looked like a great tool but would only accept a ConnectionString as a parameter meaning the migrations would run happily but any scheme changes weren’t available when the testing started.

So I’ve tweaked the SQLiteTransformationProvider and TransformationProvider slightly.

Sample Usage

In the TestFixtureSetup

_inMemoryDbConnection = new SQLiteConnection("Data Source=:memory:");
_inMemoryDbConnection.Open();
var provider = new SQLiteTransformationProvider(new SQLiteDialect(), _inMemoryDbConnection, true);
var migrator = new Migrator.Migrator(provider, typeof (M001CreateInvoicesTable).Assembly, true);
migrator.MigrateToLastVersion();

Now I can run my tests by passing in the connection to the appropriate classes.

And

I’m going to try using it for a bit and then, all being well, submit a request to the owners to have this included going forward.