This commit is contained in:
2020-03-13 19:28:54 +00:00
parent d6d69b4a0c
commit 75b18e0f0e
5 changed files with 28 additions and 6 deletions

View File

@@ -12,13 +12,18 @@ namespace AyaNova.PickList
internal static class PickListSqlBuilder
{
//Maximum number of results to return at any given time
//did a little research and may adjust this but it can be fairly girthy in this day and age
//and many people might not want or need to autocomplete type if we provide enough leeway.
//for example, if you're selecting a
const int MAXIMUM_RESULT_COUNT = 100;
//Build the query for a picklist request
internal static string Build(IAyaPickList pickList, List<string> templateColumnNames, string autoCompleteQuery)
internal static string Build(IAyaPickList pickList, List<string> templateColumnNames, string autoCompleteQuery, bool IncludeInactive)
{
//TODO: if no autocompletequery returns the first XX results without querying in natural order by column names
//if autocomplete returns teh first XX results with query in natural order by column names
//TODO: if no autocompletequery returns the first XX results without querying in natural order by column names
//if autocomplete returns teh first XX results with query in natural order by column names
//TODO: build a sql List<AyaPickListFieldDefinition> columnDefinitionsselect and order by and a where clause that searches appropriately in each field (tags)
//it should return results based on the query where there is a single name (display) column and an id column for rowid
@@ -47,9 +52,9 @@ namespace AyaNova.PickList
{//Ignore missing fields in production
var valueColumnName = o.GetSqlValueColumnName();
lSelect.Add(valueColumnName);
string sWhere=$"{valueColumnName} LIKE '%{autoCompleteQuery"
lSelect.Add(valueColumnName);
string sWhere = $"{valueColumnName} LIKE '%{autoCompleteQuery"