@hamelin.sh/compiler 0.0.6 → 0.0.8-prerelease.20250207T174927

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,21 +1,3 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- type CompileResult = { Ok: Translation } | { Err: ContextualTranslationErrors };
4
-
5
- interface Translation {
6
- sql: string;
7
- columns: Column[];
8
- }
9
-
10
- 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[] };
11
-
12
- interface Column {
13
- name: string;
14
- type: HamelinType;
15
- }
16
-
17
- type Catalog = Record<string, Column[]>;
18
-
19
1
  interface FunctionDescription {
20
2
  name: string;
21
3
  parameters: string;
@@ -24,6 +6,7 @@ interface FunctionDescription {
24
6
  interface ContextualTranslationErrors {
25
7
  hamelin: string;
26
8
  errors: TranslationErrors;
9
+ pretty: string;
27
10
  }
28
11
 
29
12
  type TranslationErrors = TranslationError[];
@@ -48,10 +31,31 @@ type LanguageArea = "FunctionCall" | "Operator" | "Deref" | "IndexAccess" | "Par
48
31
 
49
32
  type Level = "Error" | "Warning" | "Info";
50
33
 
51
- declare const compileHamelin: (catalog: Catalog, hamelinInput: string) => Promise<CompileResult>;
34
+ interface Translation {
35
+ sql: string;
36
+ columns: Column[];
37
+ }
38
+
39
+ 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[] };
40
+
41
+ interface Column {
42
+ name: string;
43
+ type: HamelinType;
44
+ }
45
+
46
+ type Catalog = Record<string, Column[]>;
47
+
48
+ type AugmentedCompileResult = {
49
+ Ok: Translation;
50
+ } | {
51
+ Err: ContextualTranslationErrors & {
52
+ prettyRaw: string;
53
+ };
54
+ };
55
+ declare const compileHamelin: (catalog: Catalog, hamelinInput: string) => Promise<AugmentedCompileResult>;
52
56
 
53
57
  declare const getFunctionDescriptions: () => Promise<FunctionDescription[]>;
54
58
 
55
59
  declare const sampleCatalog: Catalog;
56
60
 
57
- export { type Catalog, type FunctionDescription, compileHamelin, getFunctionDescriptions, sampleCatalog };
61
+ export { type AugmentedCompileResult, type Catalog, type FunctionDescription, compileHamelin, getFunctionDescriptions, sampleCatalog };