7544fd2a03bf573a9a12195d86a2fc082a88de78 tdreszer Tue Apr 5 15:17:56 2011 -0700 Tightened the screws on searching by mdb vars where the search is either for files or tables diff --git src/hg/inc/mdb.h src/hg/inc/mdb.h index 8e6d339..955f8dd 100644 --- src/hg/inc/mdb.h +++ src/hg/inc/mdb.h @@ -465,28 +465,33 @@ #define MDB_VAL_STD_TRUNCATION 64 struct mdbObj *mdbObjSearch(struct sqlConnection *conn, char *var, char *val, char *op, int limit); // Search the metaDb table for objs by var and val. Can restrict by op "is", "like", "in" and accept (non-zero) limited string size // Search is via mysql, so it's case-insensitive. Return is sorted on obj. struct mdbObj *mdbObjRepeatedSearch(struct sqlConnection *conn,struct slPair *varValPairs,boolean tables,boolean files); // Search the metaDb table for objs by var,val pairs. Uses mdbCvSearchMethod() if available. // This method will use mdbObjsQueryByVars() struct slName *mdbObjNameSearch(struct sqlConnection *conn, char *var, char *val, char *op, int limit, boolean tables, boolean files); // Search the metaDb table for objs by var and val. Can restrict by op "is" or "like" and accept (non-zero) limited string size // Search is via mysql, so it's case-insensitive. Return is sorted on obj. -struct slName *mdbValSearch(struct sqlConnection *conn, char *var, int limit, boolean tables, boolean files); +struct slName *mdbValSearch(struct sqlConnection *conn, char *var, int limit, boolean hasTableName, boolean hasFileName); // Search the metaDb table for vals by var. Can impose (non-zero) limit on returned string size of val // Search is via mysql, so it's case-insensitive. Return is sorted on val. +// Searchable vars are only for table or file objects. Further restrict to vars associated with tableName, fileName or both. -struct slPair *mdbValLabelSearch(struct sqlConnection *conn, char *var, int limit, boolean tags, boolean tables, boolean files); +struct slPair *mdbValLabelSearch(struct sqlConnection *conn, char *var, int limit, boolean tags, boolean hasTableName, boolean hasFileName); // Search the metaDb table for vals by var and returns val (as pair->name) and controlled vocabulary (cv) label // (if it exists) (as pair->val). Can impose (non-zero) limit on returned string size of name. -// if requested, return cv tag instead of mdb val. If requested, limit to table objs or file objs -// Return is case insensitive sorted on label (cv label or else val). +// Searchable vars are only for table or file objects. Further restrict to vars associated with tableName, fileName or both. +// Return is case insensitive sorted on label (cv label or else val). If requested, return cv tag instead of mdb val. #define mdbPairVal(pair) (pair)->name #define mdbPairLabel(pair) (pair)->val +struct slPair *mdbVarsSearchable(struct sqlConnection *conn, boolean hasTableName, boolean hasFileName); +// returns a white list of mdb vars that actually exist in the current DB. +// Searchable vars are only for table or file objects. Further restrict to vars associated with tableName, fileName or both. + #endif /* MDB_H */