@hamelin.sh/compiler 0.3.1 → 0.3.3
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 +29 -29
- package/dist/main.js +1 -1
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
|
@@ -1,34 +1,36 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
type CompileQueryResult = { Ok: QueryTranslation } | { Err: ContextualTranslationErrors };
|
|
4
|
-
|
|
5
3
|
type QueryDatasetsResult = { Ok: string[] } | { Err: ContextualTranslationErrors };
|
|
6
4
|
|
|
5
|
+
type CompileQueryResult = { Ok: QueryTranslation } | { Err: ContextualTranslationErrors };
|
|
6
|
+
|
|
7
7
|
interface FunctionDescription {
|
|
8
8
|
name: string;
|
|
9
9
|
parameters: string;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
interface
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
items: CompletionItem[];
|
|
12
|
+
interface Column {
|
|
13
|
+
name: string;
|
|
14
|
+
type: HamelinType;
|
|
16
15
|
}
|
|
17
16
|
|
|
18
|
-
type
|
|
17
|
+
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[] };
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
hamelin: string;
|
|
22
|
-
errors: ContextualTranslationError[];
|
|
23
|
-
completions: ContextualCompletion | undefined;
|
|
24
|
-
translation: QueryTranslation | undefined;
|
|
25
|
-
}
|
|
19
|
+
type Catalog = Record<string, Column[]>;
|
|
26
20
|
|
|
27
21
|
interface Translation {
|
|
28
22
|
sql: string;
|
|
29
23
|
columns: Column[];
|
|
30
24
|
}
|
|
31
25
|
|
|
26
|
+
interface Completion {
|
|
27
|
+
at: { start: number; end: number };
|
|
28
|
+
filter: boolean | undefined;
|
|
29
|
+
items: CompletionItem[];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
type CompletionItemKind = "Text" | "Variable" | "Function" | "Command" | "Keyword";
|
|
33
|
+
|
|
32
34
|
interface QueryTranslation {
|
|
33
35
|
translation: Translation;
|
|
34
36
|
}
|
|
@@ -66,11 +68,25 @@ interface ContextualCompletion {
|
|
|
66
68
|
completion: Completion;
|
|
67
69
|
}
|
|
68
70
|
|
|
71
|
+
interface ContextualResult {
|
|
72
|
+
hamelin: string;
|
|
73
|
+
errors: ContextualTranslationError[];
|
|
74
|
+
completions: ContextualCompletion | undefined;
|
|
75
|
+
translation: QueryTranslation | undefined;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
type Stage = "Translation" | "Parsing" | "SemanticAnalysis";
|
|
79
|
+
|
|
69
80
|
interface ContextualTranslationError {
|
|
70
81
|
error: TranslationError;
|
|
71
82
|
pretty: string;
|
|
72
83
|
}
|
|
73
84
|
|
|
85
|
+
interface Context {
|
|
86
|
+
interval: { start: number; end: number };
|
|
87
|
+
message: string;
|
|
88
|
+
}
|
|
89
|
+
|
|
74
90
|
type LanguageArea = "FunctionCall" | "Operator" | "Deref" | "IndexAccess" | "Parsing";
|
|
75
91
|
|
|
76
92
|
interface TranslationError {
|
|
@@ -87,24 +103,8 @@ interface ContextualTranslationErrors {
|
|
|
87
103
|
errors: ContextualTranslationError[];
|
|
88
104
|
}
|
|
89
105
|
|
|
90
|
-
type Stage = "Translation" | "Parsing" | "SemanticAnalysis";
|
|
91
|
-
|
|
92
|
-
interface Context {
|
|
93
|
-
interval: { start: number; end: number };
|
|
94
|
-
message: string;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
106
|
type Level = "Error" | "Warning" | "Info";
|
|
98
107
|
|
|
99
|
-
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[] };
|
|
100
|
-
|
|
101
|
-
interface Column {
|
|
102
|
-
name: string;
|
|
103
|
-
type: HamelinType;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
type Catalog = Record<string, Column[]>;
|
|
107
|
-
|
|
108
108
|
|
|
109
109
|
declare class CatalogProvider {
|
|
110
110
|
private constructor();
|