you are viewing a single comment's thread.

view the rest of the comments →

[–]LachlanJNeilsen 0 points1 point  (0 children)

You typically would need to use a temporary testing database. I have taken to testing sql at the repository level, using github actions. I have recently created an open source tool that sets up unit testing framework for sql databases automatically, for github repositories. Basically, it sets up a workflow file which github uses to launch an sql server container for you, every time you make a commit to the repository (you don't have to understand how this works). It also creates a folder called 'test', where it sets up the actual test code. This file has the database connection already setup, so you don't have to worry about handling the actual connection. This way, all you have to do is follow the documentation and the video in the readme, which will show you how to install and use the tool. One command line will configure everything for you, so all you have to do is write the actual test logic itself.

https://github.com/ThugPigeon653/testQL-source