@hamelin.sh/compiler 0.1.21 → 0.1.22

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/main.d.ts CHANGED
@@ -4,6 +4,20 @@ type CompileResult = { Ok: Translation } | { Err: ContextualTranslationErrors };
4
4
 
5
5
  type StatementDatasetsResult = { Ok: string[] } | { Err: ContextualTranslationErrors };
6
6
 
7
+ interface Translation {
8
+ sql: string;
9
+ columns: Column[];
10
+ }
11
+
12
+ type HamelinType = "binary" | "boolean" | "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[] };
13
+
14
+ interface Column {
15
+ name: string;
16
+ type: HamelinType;
17
+ }
18
+
19
+ type Catalog = Record<string, Column[]>;
20
+
7
21
  interface FunctionDescription {
8
22
  name: string;
9
23
  parameters: string;
@@ -39,20 +53,6 @@ type LanguageArea = "FunctionCall" | "Operator" | "Deref" | "IndexAccess" | "Par
39
53
 
40
54
  type Level = "Error" | "Warning" | "Info";
41
55
 
42
- type HamelinType = "binary" | "boolean" | "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[] };
43
-
44
- interface Column {
45
- name: string;
46
- type: HamelinType;
47
- }
48
-
49
- type Catalog = Record<string, Column[]>;
50
-
51
- interface Translation {
52
- sql: string;
53
- columns: Column[];
54
- }
55
-
56
56
  declare const compileHamelin: (catalog: Catalog, hamelinInput: string, timeRange?: string) => Promise<CompileResult>;
57
57
 
58
58
  declare const getFunctionDescriptions: () => Promise<FunctionDescription[]>;