7 ms·
One of my favorite features of SQLite is its memory mode. It makes writing tests really quick and easy compared to having to spin up a test Postgres database an
by trinovantes 5y ago
One of my favorite features of SQLite is its memory mode. It makes writing tests really quick and easy compared to having to spin up a test Postgres database and then deleting it.
- bob1029 5y agoWe use sqlite for everything. One novel application is the evaluation of business rules. What we do is create an in-memory sqlite DB, fill in with relevant domain info, then execute the queries against it to evaluate logical outcomes. Sqlite's unique application-defined function capability is what sold us on this path. It's very very fast too. Thousands of queries per second per instance are no problem.
- munk-a 5y agoWe've found quite a few ways to tune DB testing to make it as light as possible but yea - it's still not free by any measure - you can ensure a sane base data set (any static data, all the table schemas) and have minimally necessary writes to set up test cases but you'll never get as close to pure in memory exercise. I wonder if you could write a postgres shim layer to run your tests on a SQLite in-memory instance - though I guess you're at the whims of whatever that shim layer is doing matching actual postgres functionality bug for bug.