public void SetupIntellisence() { this.intellisenseSetuped = true; this.enableIntellisense = true; this.keywords = KeywordManager.GetKeywords(this.DatabaseType); this.builtinFunctions = FunctionManager.GetFunctionSpecifications(this.DatabaseType); this.schemaInfo = DataStore.GetSchemaInfo(this.DatabaseType); this.allWords = SqlWordFinder.FindWords(this.DatabaseType, ""); this.dbOwners = this.allWords.Where(item => item.Type == SqlWordTokenType.Owner).Select(item => item.Text).ToList(); }
private bool IsMatchWord(string word) { if (string.IsNullOrEmpty(word)) { return(false); } var words = SqlWordFinder.FindWords(this.DatabaseType, word); return(words.Count > 0); }
private void ShowWordListByToken(SqlWordToken token) { if (string.IsNullOrEmpty(token.Text)) { this.SetWordListViewVisible(false); return; } SqlWordTokenType type = this.DetectTypeByWord(token.Text); var words = SqlWordFinder.FindWords(this.DatabaseType, token.Text, type); this.ShowWordList(words); }
private void ShowDbObjects(string search, string owner = null) { IEnumerable <SqlWord> words = SqlWordFinder.FindWords(this.DatabaseType, search, SqlWordTokenType.Table | SqlWordTokenType.View | SqlWordTokenType.Function, owner); if (!string.IsNullOrEmpty(search)) { List <SqlWord> sortedWords = new List <SqlWord>(); sortedWords.AddRange(words.Where(item => item.Text.StartsWith(search, StringComparison.OrdinalIgnoreCase))); sortedWords.AddRange(words.Where(item => !item.Text.StartsWith(search, StringComparison.OrdinalIgnoreCase))); this.ShowWordList(sortedWords); } else { this.ShowWordList(words); } }
private void ShowTableColumns(string tableName, string columnName = null) { IEnumerable <SqlWord> columns = SqlWordFinder.FindWords(this.DatabaseType, columnName, SqlWordTokenType.TableColumn, tableName); this.ShowWordList(columns); }