Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: define FiltersSuggestion, FunctionsSuggestion, ValuesSuggestion, Colref, migrate update table tests to typescript #99

Merged
merged 3 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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?: ColRef;
NikitaShkaruba marked this conversation as resolved.
Show resolved Hide resolved

// 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 ColRef {
identifierChain: IdentifierChainEntry[];
}

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