8a4758bc9826bad352cbce19052b01f28fb7171c
hiram
  Fri Jul 5 11:25:55 2019 -0700
now allowing getData for any table in the database refs #23589

diff --git src/hg/hubApi/apiUtils.c src/hg/hubApi/apiUtils.c
index 43fe411..11558d2 100644
--- src/hg/hubApi/apiUtils.c
+++ src/hg/hubApi/apiUtils.c
@@ -575,15 +575,32 @@
     {
     int jsonType = autoSqlToJsonType(fi->type);
     jsonWriteObjectStart(jw, NULL);
     jsonWriteString(jw, "name", fi->name);
     jsonWriteString(jw, "sqlType", fi->type);
     jsonWriteString(jw, "jsonType",jsonTypeStrings[jsonType]);
     if (columnEl && isNotEmpty(columnEl->comment))
 	jsonWriteString(jw, "description", columnEl->comment);
     else
 	jsonWriteString(jw, "description", "");
     jsonWriteObjectEnd(jw);
     }
 jsonWriteListEnd(jw);
 }
 
+boolean trackHasData(struct trackDb *tdb)
+/* check if this is actually a data track:
+ *	TRUE when has data, FALSE if has no data
+ * When NO trackDb, can't tell at this point, will check that later
+ */
+{
+if (tdb)
+    {
+    if (tdbIsContainer(tdb) || tdbIsComposite(tdb)
+	|| tdbIsCompositeView(tdb) || tdbIsSuper(tdb))
+	return FALSE;
+    else
+	return TRUE;
+    }
+else
+    return TRUE;	/* might be true */
+}