@hamelin.sh/compiler 0.9.3 → 0.9.5

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
@@ -11,6 +11,15 @@ interface Completion {
11
11
  items: CompletionItem[];
12
12
  }
13
13
 
14
+ /**
15
+ * One output column of type `timestamp` with optional `TruncUnit` and `multiplier` from `@` truncation.
16
+ */
17
+ interface OutputTimestampColumn {
18
+ name: string;
19
+ unit?: TruncUnit;
20
+ multiplier?: number;
21
+ }
22
+
14
23
  interface BuildCatalogOutput {
15
24
  catalog: Catalog;
16
25
  errors: BuildCatalogError[];
@@ -79,6 +88,10 @@ interface FunctionDescription {
79
88
  parameters: string;
80
89
  }
81
90
 
91
+ interface GetOutputTimestampColumnsResultOk {
92
+ columns: OutputTimestampColumn[];
93
+ }
94
+
82
95
  interface TranslationError {
83
96
  area: LanguageArea | undefined;
84
97
  stage: Stage;
@@ -96,6 +109,8 @@ type CompileHamelinQueryResult = { Ok: CompileHamelinQueryResultOk } | { Err: Co
96
109
 
97
110
  type CompletionItemKind = "Text" | "Variable" | "Function" | "Command" | "Keyword";
98
111
 
112
+ type GetOutputTimestampColumnsResult = { Ok: GetOutputTimestampColumnsResultOk } | { Err: ContextualTranslationErrors };
113
+
99
114
  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 } } | { range_inclusive: { of: HamelinType } } | { struct: Column[] };
100
115
 
101
116
  type IncrementalEligibilityResult = { Eligible: { strategies: string[] } } | { NotEligible: { reasons: string[] } } | { CompilationError: ContextualTranslationErrors };
@@ -108,6 +123,8 @@ type QueryDatasetsResult = { Ok: string[] } | { Err: ContextualTranslationErrors
108
123
 
109
124
  type Stage = "Translation" | "Parsing" | "SemanticAnalysis" | "Normalization" | "Lowering";
110
125
 
126
+ type TruncUnit = "Second" | "Minute" | "Hour" | "Day" | "Week" | "Month" | "Quarter" | "Year";
127
+
111
128
  type CatalogResourceInput = Omit<CatalogResource, "isUnion"> & {
112
129
  isUnion?: boolean;
113
130
  };
@@ -148,6 +165,8 @@ declare function getFunctionDescriptions(): Promise<FunctionDescription[]>;
148
165
  */
149
166
  declare const getLimits: (hamelinQuery: string) => number[];
150
167
 
168
+ declare const getOutputTimestampColumns: (catalog: Catalog, hamelinInput: string) => Promise<GetOutputTimestampColumnsResult>;
169
+
151
170
  type FieldNames = string[] | null;
152
171
  declare const getSelectedFields: (query: string) => FieldNames;
153
172
 
@@ -159,4 +178,4 @@ declare function parseTokenValueClass(stream: {
159
178
 
160
179
  declare const sampleCatalog: Catalog;
161
180
 
162
- export { type BuildCatalogError, type BuildCatalogOutput, type Catalog, type Column, type CompileHamelinQueryResult, type CompileHamelinQueryResultOk, type Completion, type CompletionItem, type ContextualTranslationError, type ContextualTranslationErrors, type FunctionDescription, type HamelinType, type IncrementalEligibilityResult, type QuerySort, type TranslationError, buildCatalog, checkIncrementalEligibility, compileHamelinQuery, getAggregations, getCompletions, getDatasetsFromQuery, getFunctionDescriptions, getLimits, getSelectedFields, getSorts, hamelinGrammar, hamelinPrompt, parseTokenValueClass, sampleCatalog };
181
+ export { type BuildCatalogError, type BuildCatalogOutput, type Catalog, type Column, type CompileHamelinQueryResult, type CompileHamelinQueryResultOk, type Completion, type CompletionItem, type ContextualTranslationError, type ContextualTranslationErrors, type FunctionDescription, type GetOutputTimestampColumnsResult, type GetOutputTimestampColumnsResultOk, type HamelinType, type IncrementalEligibilityResult, type OutputTimestampColumn, type QuerySort, type TranslationError, type TruncUnit, buildCatalog, checkIncrementalEligibility, compileHamelinQuery, getAggregations, getCompletions, getDatasetsFromQuery, getFunctionDescriptions, getLimits, getOutputTimestampColumns, getSelectedFields, getSorts, hamelinGrammar, hamelinPrompt, parseTokenValueClass, sampleCatalog };