sqlite

SQLite, NHibernate and In-Memory database - FTW!

I recently posted about using SQLite to speed up integration tests when using NHibernate and one of the issues I was having was the inmemory database being dropped.  I had been meaning to spend some time working out what the problem was but Justin Etheredge has done the hard work and figured out the solution! Check it out here: http://www.codethinked.com/post/2008/10/19/NHibernate-20-SQLite-and-In-Memory-Databases.aspx  Good job Justin, I owe you a pint! So, for those of you that use Binsor, the updated script now looks like this: settings(keymap, item: 'item'): provider = 'NHibernate.Connection.DriverConnectionProvider' connection.driver_class = 'NHibernate.Driver.SQLite20Driver' dialect = 'NHibernate.Dialect.SQLiteDialect' connection.connection_string...

posted @ Tuesday, October 21, 2008 11:35 AM | Feedback (1)

Blisteringly fast Integration Tests with NHibernate and SQLite

One thing I love about using NHibernate as my O/RM is being able to push the database schema from the domain.  This lets me create the database from scratch for each integration test fixture and get it into the required state.  Creating the database with NHibernate is quick and simple.  Hell, here is the code to do it: Configuration cfg = container.Resolve<Configuration>(); SchemaExport export = new SchemaExport(cfg); export.Execute(true, true, false, true); Nifty, eh? But tests that hit the database are sloooow, and these quickly become tests that are not ran. Tests that query the database are slow, and because I regenerate the whole database...

posted @ Friday, October 10, 2008 11:29 AM | Feedback (4)