why have this here and then a `get_insert_pattern` ?

It looks like this `__init__` is doing a lot of things when it could probably be a bit lazier and do this when certain things are called.

For example, it could have something like `self.cursor = db.cursor()` but instead of calling the cursor in the `__init__` you could have methods for that, so that it then becomes reusable.

Imagine down the rode we want to execute something else with the cursor. We wouldn't be able to do it because the cursor you are using is doing everything in the constructor.