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