5c9ad606d5b486c3e1360250907cae2c13869d90
braney
  Sun Mar 29 12:52:58 2026 -0700
Factor out common quickLift SQL load pattern into shared functions

Add quickLiftResolveTable() and quickLiftSqlLoadBeds() to eliminate
duplicated custom-track resolution and SQL-based quickLift loading
code across bedTrack.c, simpleTracks.c, gvfTrack.c, and hgc.c.

No redmine

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

diff --git src/hg/inc/quickLift.h src/hg/inc/quickLift.h
index f0bde6307eb..e58cbe6f930 100644
--- src/hg/inc/quickLift.h
+++ src/hg/inc/quickLift.h
@@ -58,16 +58,29 @@
 
 char *quickLiftGetChainPath(struct cart *, char *fromDb, char *toDb);
 /* Return the path from the quickLiftChain table for given assemblies. */
 
 struct bed *quickLiftBeds(struct bed *bedList, struct hash *chainHash, boolean blocked);
 // Map a list of bedd in query coordinates to our current reference
 
 boolean quickLiftEnabled(struct cart *cart);
 /* Return TRUE if feature is available */
 
 struct quickLiftRegions *quickLiftGetRegions(char *ourDb, char *liftDb, char *quickLiftFile, char *chrom, int seqStart, int seqEnd);
 /* Figure out the highlight regions and cache them. */
 
 char *quickLiftChainTable();
 /* Return the name of the quickLiftChain table. */
+
+void quickLiftResolveTable(struct trackDb *tdb, char *trackTable, char **retTable, char **retLiftDb);
+/* Resolve the table name and liftDb for a quickLift track.  For custom tracks,
+ * sets *retLiftDb to CUSTOM_TRASH and *retTable to the dbTableName setting;
+ * otherwise sets *retTable to trackTable. Caller should have already set
+ * *retLiftDb to trackDbSetting(tdb, "quickLiftDb"). */
+
+struct bed *quickLiftSqlLoadBeds(struct trackDb *tdb, char *trackTable, char *liftDb,
+    char *chrom, int start, int end, char *extraWhere,
+    ItemLoader2 loader, int numFields, boolean blocked);
+/* Load items from another assembly via quickLift SQL, map them back to the reference,
+ * and return the lifted beds.  Handles custom track table resolution internally.
+ * Caller provides liftDb from trackDbSetting(tdb, "quickLiftDb"). */
 #endif