@hamelin.sh/compiler 0.1.5 → 0.1.6

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
@@ -1,16 +1,4 @@
1
- interface Translation {
2
- sql: string;
3
- columns: Column[];
4
- }
5
-
6
- 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[] };
7
-
8
- interface Column {
9
- name: string;
10
- type: HamelinType;
11
- }
12
-
13
- type Catalog = Record<string, Column[]>;
1
+ type StatementDatasetsResult = { Ok: string[] } | { Err: ContextualTranslationErrors };
14
2
 
15
3
  interface FunctionDescription {
16
4
  name: string;
@@ -45,6 +33,20 @@ type LanguageArea = "FunctionCall" | "Operator" | "Deref" | "IndexAccess" | "Par
45
33
 
46
34
  type Level = "Error" | "Warning" | "Info";
47
35
 
36
+ 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[] };
37
+
38
+ interface Column {
39
+ name: string;
40
+ type: HamelinType;
41
+ }
42
+
43
+ type Catalog = Record<string, Column[]>;
44
+
45
+ interface Translation {
46
+ sql: string;
47
+ columns: Column[];
48
+ }
49
+
48
50
  type AugmentedCompileResult = {
49
51
  Ok: Translation;
50
52
  } | {
@@ -56,6 +58,8 @@ declare const compileHamelin: (catalog: Catalog, hamelinInput: string, timeRange
56
58
 
57
59
  declare const getFunctionDescriptions: () => Promise<FunctionDescription[]>;
58
60
 
61
+ declare const getDatasetsFromQuery: (catalog: Catalog, hamelinInput: string) => Promise<StatementDatasetsResult>;
62
+
59
63
  declare const sampleCatalog: Catalog;
60
64
 
61
- export { type AugmentedCompileResult, type Catalog, type FunctionDescription, compileHamelin, getFunctionDescriptions, sampleCatalog };
65
+ export { type AugmentedCompileResult, type Catalog, type FunctionDescription, compileHamelin, getDatasetsFromQuery, getFunctionDescriptions, sampleCatalog };