code: private Referenceable registerDatabase(String databaseName) throws Exception {
          Referenceable dbRef = getDatabaseReference(clusterName, databaseName);
          Database db = hiveClient.getDatabase(databaseName);
  
          if (db != null) {
              if (dbRef == null) {
                  dbRef = createDBInstance(db);
                  dbRef = registerInstance(dbRef);
              } else {
                  LOG.info("Database {} is already registered with id {}. Updating it.", databaseName, dbRef.getId().id);
                  dbRef = createOrUpdateDBInstance(db, dbRef);
                  updateInstance(dbRef);
              }
          }
          return dbRef;
      }
docs: Checks if db is already registered, else creates and registers db entity
  @param databaseName
  @return
  @throws Exception