Exemplo n.º 1
0
        public static SuggestionList GetSuggestions(string keyword)
        {
            fp.lib.sqlparser.Query q = T.Coalesce(Parser.currentQuery, query);
            if (q != null)
            {
                lock (query)
                {
                    SuggestionList suggestions = new SuggestionList(q, keyword);
                    if (suggestions.BuildSuggestionList() > 0)
                    {
                        return(suggestions);
                    }
                }
            }

            return(null);
        }
Exemplo n.º 2
0
        public static SuggestionList GetSuggestions(string text, int position)
        {
            if (Parser.currentQuery != null)
            {
                lock (query)
                {
                    SuggestionList suggestions = new SuggestionList(Parser.currentQuery, Parser.currentKeyword);
                    suggestions.enableSuggestColumns     = S.Get("AutocompleteColumns", true);
                    suggestions.enableSuggestTables      = S.Get("AutocompleteTables", true);
                    suggestions.enableSuggestAliases     = S.Get("AutocompleteAliases", true);
                    suggestions.enableAutoSuggestAliases = S.Get("AutocompleteInsertAliases", false);
                    suggestions.enableSuggestKeywords    = S.Get("AutocompleteKeywords", true);
                    suggestions.enableSuggestJoins       = S.Get("AutocompleteJoins", true);
                    if (suggestions.BuildSuggestionList(text, position) > 0)
                    {
                        return(suggestions);
                    }
                }
            }

            return(null);
        }