juxt

2016-07-18T21:43:45.000005Z

I’m trying to test some DB-using code and I’m using joplin.

2016-07-18T21:46:45.000006Z

I’m using SQLite :memory: databases, since I want the database to be totally fresh for every test so every test does (joplin/migrate-db {:db {:type :jdbc :url “jdbc:sqlite::memory:” …) before running the test but I’m getting an SQL exception about the ragtime_migrations table not existing.

2016-07-18T21:47:37.000007Z

Mmm, thinking about this it’s probably because something doesn’t hold onto the connection long enough, so between two calls there’s a totally new database.

2016-07-18T22:08:01.000008Z

I think the difficulty here is that joplin only wants a URL and every time something attempts to open the URL jdbc:sqlite::memory: it will get a totally new database, since I can’t pass my connection object into the target map to migrate-db I don’t know how to stop this from happening.