sql-autocomplete-parsers
Advanced tools
Comparing version 1.10.0 to 1.11.0
# Changelog | ||
## [1.11.0](https://github.com/gravity-ui/sql-autocomplete-parsers/compare/v1.10.0...v1.11.0) (2023-07-11) | ||
### Features | ||
* specify locations in ParseResult ([#48](https://github.com/gravity-ui/sql-autocomplete-parsers/issues/48)) ([bf348b8](https://github.com/gravity-ui/sql-autocomplete-parsers/commit/bf348b8efb1d7b2a5c44787299aaf57ae916e7ad)) | ||
## [1.10.0](https://github.com/gravity-ui/sql-autocomplete-parsers/compare/v1.9.0...v1.10.0) (2023-07-10) | ||
@@ -4,0 +11,0 @@ |
{ | ||
"name": "sql-autocomplete-parsers", | ||
"version": "1.10.0", | ||
"version": "1.11.0", | ||
"description": "A library that provides autocompletion and errors highlighting for various sql dialects", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -11,2 +11,3 @@ // @ts-ignore | ||
export interface ParseResult { | ||
locations: StatementPart[]; | ||
errors?: SyntaxError[]; | ||
@@ -38,2 +39,41 @@ suggestKeywords?: KeywordSuggestion[]; | ||
export type StatementPart = | ||
{ | ||
type: 'statement' | ||
location: Location | ||
} | ||
| { | ||
type: 'statementType' | ||
location: Location | ||
identifier: string | ||
} | ||
| { | ||
type: 'selectList' | ||
location: Location | ||
missing?: boolean | ||
subquery?: true | ||
} | ||
| { | ||
type: 'asterisk' | ||
location: Location | ||
tables: Table[]; | ||
} | ||
| { | ||
type: 'table' | ||
location: Location | ||
identifierChain: IdentifierChainEntry[] | ||
} | ||
| { | ||
type: 'whereClause' | ||
location: Location | ||
missing: boolean | ||
subquery?: true | ||
} | ||
| { | ||
type: 'limitClause' | ||
location: Location | ||
missing: boolean | ||
subquery?: true | ||
}; | ||
export interface KeywordSuggestion { | ||
@@ -40,0 +80,0 @@ value: string; |
6447034
88589