@hamelin.sh/compiler 0.2.12 → 0.2.13
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/dist/iife.js +1 -1
- package/dist/main.d.ts +32 -32
- package/dist/main.js +1 -1
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
type QueryDatasetsResult = { Ok: string[] } | { Err: ContextualTranslationErrors };
|
|
4
|
+
|
|
3
5
|
type CompileQueryResult = { Ok: QueryTranslation } | { Err: ContextualTranslationErrors };
|
|
4
6
|
|
|
5
|
-
type
|
|
7
|
+
type CompletionItemKind = "Text" | "Variable" | "Function" | "Command" | "Keyword";
|
|
6
8
|
|
|
7
9
|
interface CompletionItem {
|
|
8
10
|
/**
|
|
@@ -32,8 +34,15 @@ interface CompletionItem {
|
|
|
32
34
|
section: string | undefined;
|
|
33
35
|
}
|
|
34
36
|
|
|
35
|
-
interface
|
|
36
|
-
|
|
37
|
+
interface Completion {
|
|
38
|
+
at: { start: number; end: number };
|
|
39
|
+
filter: boolean | undefined;
|
|
40
|
+
items: CompletionItem[];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
interface Translation {
|
|
44
|
+
sql: string;
|
|
45
|
+
columns: Column[];
|
|
37
46
|
}
|
|
38
47
|
|
|
39
48
|
interface ContextualCompletion {
|
|
@@ -48,56 +57,45 @@ interface ContextualResult {
|
|
|
48
57
|
translation: QueryTranslation | undefined;
|
|
49
58
|
}
|
|
50
59
|
|
|
51
|
-
|
|
60
|
+
interface QueryTranslation {
|
|
61
|
+
translation: Translation;
|
|
62
|
+
}
|
|
52
63
|
|
|
53
|
-
interface
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
64
|
+
interface TranslationError {
|
|
65
|
+
area: LanguageArea | undefined;
|
|
66
|
+
stage: Stage;
|
|
67
|
+
level: Level;
|
|
68
|
+
primary: Context;
|
|
69
|
+
supporting: Context[] | undefined;
|
|
70
|
+
source_desc: string | undefined;
|
|
57
71
|
}
|
|
58
72
|
|
|
59
|
-
interface
|
|
60
|
-
|
|
61
|
-
|
|
73
|
+
interface ContextualTranslationError {
|
|
74
|
+
error: TranslationError;
|
|
75
|
+
pretty: string;
|
|
62
76
|
}
|
|
63
77
|
|
|
64
|
-
type
|
|
78
|
+
type LanguageArea = "FunctionCall" | "Operator" | "Deref" | "IndexAccess" | "Parsing";
|
|
65
79
|
|
|
66
80
|
interface ContextualTranslationErrors {
|
|
67
81
|
hamelin: string;
|
|
68
82
|
errors: ContextualTranslationError[];
|
|
69
83
|
}
|
|
70
84
|
|
|
71
|
-
type
|
|
85
|
+
type Stage = "Translation" | "Parsing" | "SemanticAnalysis";
|
|
86
|
+
|
|
87
|
+
type Level = "Error" | "Warning" | "Info";
|
|
72
88
|
|
|
73
89
|
interface Context {
|
|
74
90
|
interval: { start: number; end: number };
|
|
75
91
|
message: string;
|
|
76
92
|
}
|
|
77
93
|
|
|
78
|
-
type Stage = "Translation" | "Parsing" | "SemanticAnalysis";
|
|
79
|
-
|
|
80
|
-
interface ContextualTranslationError {
|
|
81
|
-
error: TranslationError;
|
|
82
|
-
pretty: string;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
interface TranslationError {
|
|
86
|
-
area: LanguageArea | undefined;
|
|
87
|
-
stage: Stage;
|
|
88
|
-
level: Level;
|
|
89
|
-
primary: Context;
|
|
90
|
-
supporting: Context[] | undefined;
|
|
91
|
-
source_desc: string | undefined;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
94
|
interface FunctionDescription {
|
|
95
95
|
name: string;
|
|
96
96
|
parameters: string;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
type Catalog = Record<string, Column[]>;
|
|
100
|
-
|
|
101
99
|
interface Column {
|
|
102
100
|
name: string;
|
|
103
101
|
type: HamelinType;
|
|
@@ -105,6 +103,8 @@ interface Column {
|
|
|
105
103
|
|
|
106
104
|
type HamelinType = "binary" | "boolean" | "interval" | "calendar_interval" | "int" | "double" | "rows" | "string" | "timestamp" | "unknown" | { decimal: { precision: number; scale: number } } | { array: { element_type: HamelinType } } | { map: { key_type: HamelinType; value_type: HamelinType } } | { tuple: { elements: HamelinType[] } } | "variant" | { range: { of: HamelinType } } | { struct: Column[] };
|
|
107
105
|
|
|
106
|
+
type Catalog = Record<string, Column[]>;
|
|
107
|
+
|
|
108
108
|
declare class CatalogProvider {
|
|
109
109
|
private constructor();
|
|
110
110
|
free(): void;
|
|
@@ -178,4 +178,4 @@ declare const sampleCatalog: Catalog;
|
|
|
178
178
|
*/
|
|
179
179
|
declare function getSyntaxCompletions(input: string, pos: number): Completion | null;
|
|
180
180
|
|
|
181
|
-
export { type Catalog, type Column, type Completion, type CompletionItem, type ContextualResult, type ContextualTranslationError, type ContextualTranslationErrors, type FunctionDescription, type HamelinType, type QuerySort, type QueryTranslation, type Translation, type TranslationError, compileHamelin, createCompiler, getAggregations, getDatasetsFromQuery, getFunctionDescriptions, getLimits, getSelectedFields, getSorts, getSyntaxCompletions, hamelinGrammar, hamelinPrompt, parseTokenValueClass, sampleCatalog };
|
|
181
|
+
export { type Catalog, type Column, type CompileQueryResult, type Completion, type CompletionItem, type ContextualResult, type ContextualTranslationError, type ContextualTranslationErrors, type FunctionDescription, type HamelinType, type QuerySort, type QueryTranslation, type Translation, type TranslationError, compileHamelin, createCompiler, getAggregations, getDatasetsFromQuery, getFunctionDescriptions, getLimits, getSelectedFields, getSorts, getSyntaxCompletions, hamelinGrammar, hamelinPrompt, parseTokenValueClass, sampleCatalog };
|