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