Skip to content

Commit

Permalink
feat: define FiltersSuggestion, FunctionsSuggestion, ValuesSuggestion…
Browse files Browse the repository at this point in the history
…, Colref, migrate update table tests to typescript (#99)

* feat: define FiltersSuggestion, FunctionsSuggestion, ValuesSuggestion, Colref

* feat: migrate update table tests to typescript

* fix: codestyle fixes

---------

Co-authored-by: robhovsepyan <[email protected]>
  • Loading branch information
roberthovsepyan and robhovsepyan authored Dec 1, 2023
1 parent 7520b13 commit 4b99563
Show file tree
Hide file tree
Showing 3 changed files with 520 additions and 852 deletions.
25 changes: 23 additions & 2 deletions src/parsing/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,17 @@ export interface ParseResult {
suggestColumnAliases?: ColumnAliasSuggestion[];
suggestCommonTableExpressions?: unknown;
suggestDatabases?: DatabasesSuggestion;
suggestFilters?: unknown;
suggestFunctions?: unknown;
suggestFilters?: FiltersSuggestion;
suggestFunctions?: FunctionsSuggestion;
suggestValues?: ValuesSuggestion;
suggestGroupBys?: unknown;
suggestIdentifiers?: IdentifierSuggestion[];
suggestTemplates?: boolean;
suggestEngines?: {
engines: Engines;
functionalEngines: Engines;
};
colRef?: ColumnReference;

// Reasons for those fields are unknown
definitions?: []; // TODO: figure our if it's optional
Expand Down Expand Up @@ -106,9 +108,28 @@ export interface AggregateFunctionsSuggestion {

export interface ColumnSuggestion {
source?: string; // TODO: figure our if it's optional
types?: string[];
tables: Table[];
}

export interface FunctionsSuggestion {
types?: string[];
}

export interface FiltersSuggestion {
prefix?: string;
tables: Table[];
}

export interface ValuesSuggestion {
missingEndQuote?: boolean;
partialQuote?: boolean;
}

export interface ColumnReference {
identifierChain: IdentifierChainEntry[];
}

export interface KeywordSuggestion {
value: string;
weight: number;
Expand Down
Loading

0 comments on commit 4b99563

Please sign in to comment.