Fork me on GitHub

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


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.


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.


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.