I much prefer having an in-memory database than mock what a database does.
Which sounds great in theory but then you get to find where your prod DB and testing DB differ and you have to keep chasing that. Unless you are using something like SQLite which has both (disk and in-memory) as an option.
I worked at a place that used a different in-memory DB (H2, IIRC) in place of our MySQL DB for testing. It ended up being hell to maintain and had to have hacks for how H2 and MySQL differ (tests would work in H2 but fail if run against MySQL or vice versa).
Dealing with this now at work. Got a dev whose time in the industry should make him a senior dev but he gives off massive junior vibes.
The need to change everything he touches
Wanting to write clever code over straightforward code
Everything “needs” a refactor
Just deprecates things when he doesn’t want to learn them and writes a new implementation without updating old code
Thinks he knows best while not understanding huge swaths of the codebase
Everything he can’t understand in <5 min is stupid and wrong
If he was less competent (when kept in a box and closely monitored) I’d be pushing even harder to get rid of him.