@questdb/sql-parser 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/LICENSE +190 -0
- package/README.md +228 -0
- package/dist/autocomplete/content-assist.d.ts +52 -0
- package/dist/autocomplete/index.d.ts +5 -0
- package/dist/autocomplete/provider.d.ts +20 -0
- package/dist/autocomplete/suggestion-builder.d.ts +16 -0
- package/dist/autocomplete/token-classification.d.ts +45 -0
- package/dist/autocomplete/types.d.ts +78 -0
- package/dist/grammar/constants.d.ts +1 -0
- package/dist/grammar/dataTypes.d.ts +1 -0
- package/dist/grammar/functions.d.ts +1 -0
- package/dist/grammar/index.cjs +709 -0
- package/dist/grammar/index.d.ts +5 -0
- package/dist/grammar/index.js +678 -0
- package/dist/grammar/keywords.d.ts +1 -0
- package/dist/grammar/operators.d.ts +1 -0
- package/dist/index.cjs +10363 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.js +10302 -0
- package/dist/parser/ast.d.ts +794 -0
- package/dist/parser/lexer.d.ts +53 -0
- package/dist/parser/parser.d.ts +170 -0
- package/dist/parser/toSql.d.ts +2 -0
- package/dist/parser/tokens.d.ts +311 -0
- package/dist/parser/visitor.d.ts +191 -0
- package/package.json +88 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Statement } from "./parser/ast";
|
|
2
|
+
export interface ParseResult {
|
|
3
|
+
ast: Statement[];
|
|
4
|
+
errors: Array<{
|
|
5
|
+
message: string;
|
|
6
|
+
line?: number;
|
|
7
|
+
column?: number;
|
|
8
|
+
}>;
|
|
9
|
+
}
|
|
10
|
+
export * from "./parser/ast";
|
|
11
|
+
export type { ContentAssistResult, TableRef, } from "./autocomplete/content-assist";
|
|
12
|
+
export type { AutocompleteProvider, Suggestion, SchemaInfo, TableInfo, ColumnInfo, } from "./autocomplete/index";
|
|
13
|
+
export { QuestDBLexer, tokenize, allTokens } from "./parser/lexer";
|
|
14
|
+
export { parser, parse } from "./parser/parser";
|
|
15
|
+
export { visitor } from "./parser/visitor";
|
|
16
|
+
export { toSql } from "./parser/toSql";
|
|
17
|
+
export { Select, From, Where, Insert, Update, Delete, Create, Drop, Alter, Table, Sample, By, Latest, On, Partition, } from "./parser/lexer";
|
|
18
|
+
export { getContentAssist, getNextValidTokens, isTokenExpected, } from "./autocomplete/content-assist";
|
|
19
|
+
export { createAutocompleteProvider } from "./autocomplete/index";
|
|
20
|
+
export { SuggestionKind, SuggestionPriority } from "./autocomplete/index";
|
|
21
|
+
export { IDENTIFIER_TOKENS, IDENTIFIER_KEYWORD_TOKENS, SKIP_TOKENS, tokenNameToKeyword, buildSuggestions, } from "./autocomplete/index";
|
|
22
|
+
export { keywords, dataTypes, constants, functions, operators, } from "./grammar/index";
|
|
23
|
+
/**
|
|
24
|
+
* Parse SQL string to AST
|
|
25
|
+
*/
|
|
26
|
+
export declare function parseToAst(sql: string): ParseResult;
|
|
27
|
+
/**
|
|
28
|
+
* Parse multiple SQL statements (no semicolons needed)
|
|
29
|
+
*/
|
|
30
|
+
export declare function parseStatements(sql: string): Statement[];
|
|
31
|
+
/**
|
|
32
|
+
* Parse single SQL statement and return AST
|
|
33
|
+
*/
|
|
34
|
+
export declare function parseOne(sql: string): Statement;
|