3 ms·
I hate this practice that some companies do of testing their sql database usage... By using another database. For postgres, if you are using the jvm, you can us
by greiskul 5y ago
I hate this practice that some companies do of testing their sql database usage... By using another database. For postgres, if you are using the jvm, you can use the amazing test containers library to test reasonably fast, with a postgres database that you can set up to be the same version as you use in production.
Any database vendor should either support having their database used quickly in test like these, or at least release a simplified in memory version of their database so people can test their code. If your database is not testable, that should be a black mark against choosing it for a project.
- syspec 5y agoWhich library are you referring to? I'm new to jvm programming, and was wondering about this as I'm used to rails where the test db is spun up on your behalf and is usually the same db
- djbusby 5y agoFor PG you can just initdb in a tmpfs.
- denysvitali 5y agoOr (and this can be done with pretty much everything) spin up a container
- thejosh 5y agoWith elixir and ecto it wraps the whole thing in a transaction so it runs Async across multiple tests.
- deleted 5y ago[deleted]
- closeparen 5y agoMuch better than mocking out cursor objects!