def open(self): ''' Creates the neccessary data structures and opens the underlying database. To tune the underlying options for the database read the following: http://docs.basho.com/riak/1.0.0/tutorials/choosing-a-backend/LevelDB/ :throws DatabaseException: If an error has occurred ''' options = self.get_open_options() try: error = new_native_string() self.database = LDB.leveldb_open(options, self.filename, get_reference_to(error)) self.handle_error(error) finally: LDB.leveldb_options_destroy(options)