Skip to content

Commit

Permalink
feat: extend StatementPart, make TestCase fields optional, migrate lo…
Browse files Browse the repository at this point in the history
…cation tests to typescript and move files to select folder (#107)

* refactor: extend StatementPart, make TestCase fields optional

* refactor: migrate generic location tests to typescript and move file to select folder

* refactor: migrate clickhouse location tests to typescript and move file to select folder

* refactor: migrate postgresql location tests to typescript and move file to select folder

---------

Co-authored-by: robhovsepyan <[email protected]>
  • Loading branch information
roberthovsepyan and robhovsepyan authored Dec 5, 2023
1 parent 36b291c commit 8b6b2c4
Show file tree
Hide file tree
Showing 8 changed files with 4,033 additions and 4,000 deletions.
38 changes: 37 additions & 1 deletion src/autocomplete/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,43 @@ export type StatementPart =
location: Location;
missing: boolean;
subquery?: true;
}
| {
type: 'function';
location: Location;
function: string;
}
| {
type: 'functionArgument';
location: Location;
function: string;
argumentPosition: number;
identifierChain: IdentifierChainEntry[];
expression: Expression;
}
| {
type: 'alias';
alias: string;
location: Location;
source?: string;
parentLocation?: Location;
target?: string;
identifierChain?: IdentifierChainEntry[];
}
| {
type: 'complex';
location: Location;
identifierChain: IdentifierChainEntry[];
tables: Table[];
qualified: boolean;
};

interface Expression {
types?: string[];
text?: string;
columnReference?: IdentifierChainEntry[];
}

export interface TablesSuggestion {
prependFrom?: boolean;
prependQuestionMark?: boolean;
Expand Down Expand Up @@ -164,8 +199,9 @@ export interface Location {
}

export interface Table {
identifierChain?: IdentifierChainEntry[];
alias?: string;
identifierChain: IdentifierChainEntry[];
subQuery?: string;
}

export interface IdentifierChainEntry {
Expand Down
Loading

0 comments on commit 8b6b2c4

Please sign in to comment.