best way is to refactor your code so that any logic is decoupled from executing database query. then split tests into unit tests and integration tests. in unit tests you mock your database and test your logic. in integration tests you test only database part, without touching any other high level components.
to do it correctly you should run tests against you real database. if you think about any optimisations that you can think about supporting also another, faster, database (in-memory one). then you can your db tests frequently using in-memory db and then just once (or only a few times) run tests against your real database. but to set up and maintain environment and configuration for different dbs is time consuming so you have to calculate which takes more time in your case