Fork me on GitHub
#juxt
<
2016-07-18
>
jonathanj21:07:45

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

jonathanj21:07:45

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.

jonathanj21:07:37

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.

jonathanj22:07:01

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.