I am making a class to unify the way we deal with the database and I want to make sure the connection is closed when the object is not used anymore, the class is something like