Add open function to open the database with an optional path
Open db at the startup of the application, if not successful terminate