@malloydata/malloy 0.0.335 → 0.0.337
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/CONTEXT.md +4 -3
- package/MALLOY_API.md +129 -0
- package/dist/annotation.d.ts +0 -2
- package/dist/annotation.js +29 -23
- package/dist/api/asynchronous.d.ts +1 -1
- package/dist/api/foundation/cache.d.ts +32 -0
- package/dist/api/foundation/cache.js +92 -0
- package/dist/api/foundation/compile.d.ts +201 -0
- package/dist/api/foundation/compile.js +429 -0
- package/dist/api/foundation/core.d.ts +493 -0
- package/dist/api/foundation/core.js +1247 -0
- package/dist/api/foundation/document.d.ts +167 -0
- package/dist/api/foundation/document.js +206 -0
- package/dist/api/foundation/index.d.ts +10 -0
- package/dist/api/foundation/index.js +77 -0
- package/dist/api/foundation/readers.d.ts +53 -0
- package/dist/api/foundation/readers.js +134 -0
- package/dist/api/foundation/result.d.ts +185 -0
- package/dist/api/foundation/result.js +704 -0
- package/dist/api/foundation/runtime.d.ts +361 -0
- package/dist/api/foundation/runtime.js +733 -0
- package/dist/api/foundation/types.d.ts +54 -0
- package/dist/api/foundation/types.js +7 -0
- package/dist/api/foundation/writers.d.ts +42 -0
- package/dist/api/foundation/writers.js +230 -0
- package/dist/api/util.d.ts +1 -1
- package/dist/connection/base_connection.d.ts +5 -0
- package/dist/connection/index.d.ts +1 -0
- package/dist/connection/index.js +1 -0
- package/dist/connection/registry.d.ts +73 -0
- package/dist/connection/registry.js +106 -0
- package/dist/connection/types.d.ts +5 -15
- package/dist/dialect/duckdb/duckdb.js +2 -1
- package/dist/dialect/snowflake/snowflake.js +7 -1
- package/dist/dialect/trino/trino.js +7 -2
- package/dist/index.d.ts +9 -4
- package/dist/index.js +37 -26
- package/dist/lang/ast/error-factory.js +3 -5
- package/dist/lang/ast/source-elements/query-source.js +2 -7
- package/dist/lang/ast/source-elements/refined-source.js +11 -1
- package/dist/lang/ast/source-elements/sql-source.d.ts +1 -1
- package/dist/lang/ast/source-elements/sql-source.js +18 -3
- package/dist/lang/ast/sql-elements/sql-string.d.ts +2 -2
- package/dist/lang/ast/sql-elements/sql-string.js +18 -1
- package/dist/lang/ast/statements/define-source.js +7 -2
- package/dist/lang/ast/statements/import-statement.js +53 -21
- package/dist/lang/ast/types/document-compile-result.d.ts +1 -0
- package/dist/lang/ast/types/malloy-element.d.ts +3 -1
- package/dist/lang/ast/types/malloy-element.js +23 -7
- package/dist/lang/malloy-to-ast.d.ts +1 -1
- package/dist/lang/malloy-to-ast.js +1 -1
- package/dist/lang/parse-malloy.d.ts +3 -2
- package/dist/lang/parse-malloy.js +14 -25
- package/dist/lang/test/test-translator.js +1 -0
- package/dist/lang/translate-response.d.ts +1 -0
- package/dist/model/constant_expression_compiler.js +6 -7
- package/dist/model/index.d.ts +3 -1
- package/dist/model/index.js +15 -9
- package/dist/model/malloy_types.d.ts +89 -15
- package/dist/model/malloy_types.js +12 -0
- package/dist/model/persist_utils.d.ts +47 -0
- package/dist/model/persist_utils.js +257 -0
- package/dist/model/query_model_impl.d.ts +2 -4
- package/dist/model/query_model_impl.js +5 -13
- package/dist/model/query_node.d.ts +1 -2
- package/dist/model/query_node.js +3 -13
- package/dist/model/query_query.d.ts +17 -1
- package/dist/model/query_query.js +81 -36
- package/dist/model/source_def_utils.d.ts +50 -0
- package/dist/model/source_def_utils.js +154 -0
- package/dist/model/sql_block.d.ts +5 -1
- package/dist/model/sql_block.js +29 -4
- package/dist/model/sql_compiled.d.ts +29 -0
- package/dist/model/sql_compiled.js +102 -0
- package/dist/model/stage_writer.d.ts +1 -3
- package/dist/model/stage_writer.js +7 -25
- package/dist/model/utils.d.ts +20 -1
- package/dist/model/utils.js +40 -0
- package/dist/run_sql_options.d.ts +0 -1
- package/dist/taggable.d.ts +10 -0
- package/dist/taggable.js +7 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +6 -4
- package/dist/malloy.d.ts +0 -1365
- package/dist/malloy.js +0 -3421
- package/dist/model/materialization/utils.d.ts +0 -3
- package/dist/model/materialization/utils.js +0 -41
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
import type { Connection, LookupConnection } from '../../connection/types';
|
|
2
|
+
import type { URLReader, EventStream } from '../../runtime_types';
|
|
3
|
+
import type { ModelDef, Query as InternalQuery, SearchIndexResult, SearchValueMapResult, QueryRunStats } from '../../model';
|
|
4
|
+
import type { Dialect } from '../../dialect';
|
|
5
|
+
import type { RunSQLOptions } from '../../run_sql_options';
|
|
6
|
+
import type { CacheManager } from './cache';
|
|
7
|
+
import type { ParseOptions, CompileOptions, CompileQueryOptions } from './types';
|
|
8
|
+
import type { PreparedResult, Explore } from './core';
|
|
9
|
+
import { Model, PreparedQuery } from './core';
|
|
10
|
+
import type { DataRecord, Result } from './result';
|
|
11
|
+
type ModelURL = URL;
|
|
12
|
+
type ModelString = string;
|
|
13
|
+
type QueryURL = URL;
|
|
14
|
+
type QueryString = string;
|
|
15
|
+
type Connectionable = {
|
|
16
|
+
connection: Connection;
|
|
17
|
+
connections?: undefined;
|
|
18
|
+
} | {
|
|
19
|
+
connections: LookupConnection<Connection>;
|
|
20
|
+
connection?: undefined;
|
|
21
|
+
};
|
|
22
|
+
declare class FluentState<T> {
|
|
23
|
+
protected runtime: Runtime;
|
|
24
|
+
private readonly _materialize;
|
|
25
|
+
private materialized;
|
|
26
|
+
constructor(runtime: Runtime, materialize: () => Promise<T>);
|
|
27
|
+
protected materialize(): Promise<T>;
|
|
28
|
+
protected rematerialize(): Promise<T>;
|
|
29
|
+
protected makeQueryMaterializer(materialize: () => Promise<PreparedQuery>, options?: CompileQueryOptions): QueryMaterializer;
|
|
30
|
+
protected makeExploreMaterializer(materialize: () => Promise<Explore>, options?: CompileQueryOptions): ExploreMaterializer;
|
|
31
|
+
protected makePreparedResultMaterializer(materialize: () => Promise<PreparedResult>): PreparedResultMaterializer;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* An environment for compiling and running Malloy queries.
|
|
35
|
+
*/
|
|
36
|
+
export declare class Runtime {
|
|
37
|
+
isTestRuntime: boolean;
|
|
38
|
+
private _urlReader;
|
|
39
|
+
private _connections;
|
|
40
|
+
private _eventStream;
|
|
41
|
+
private _cacheManager;
|
|
42
|
+
constructor({ urlReader, connections, connection, eventStream, cacheManager, }: {
|
|
43
|
+
urlReader?: URLReader;
|
|
44
|
+
eventStream?: EventStream;
|
|
45
|
+
cacheManager?: CacheManager;
|
|
46
|
+
} & Connectionable);
|
|
47
|
+
/**
|
|
48
|
+
* @return The `CacheManager` for this runtime instance.
|
|
49
|
+
*/
|
|
50
|
+
get cacheManager(): CacheManager | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* @return The `URLReader` for this runtime instance.
|
|
53
|
+
*/
|
|
54
|
+
get urlReader(): URLReader;
|
|
55
|
+
/**
|
|
56
|
+
* @return The `LookupConnection<Connection>` for this runtime instance.
|
|
57
|
+
*/
|
|
58
|
+
get connections(): LookupConnection<Connection>;
|
|
59
|
+
/**
|
|
60
|
+
* @return The `EventStream` for this runtime instance.
|
|
61
|
+
*/
|
|
62
|
+
get eventStream(): EventStream | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* Load a Malloy model by URL or contents.
|
|
65
|
+
*
|
|
66
|
+
* @param source The model URL or contents to load and (eventually) compile.
|
|
67
|
+
* @return A `ModelMaterializer` capable of materializing the requested model,
|
|
68
|
+
* or loading further related objects.
|
|
69
|
+
*/
|
|
70
|
+
loadModel(source: ModelURL | ModelString, options?: ParseOptions & CompileOptions & CompileQueryOptions): ModelMaterializer;
|
|
71
|
+
_loadModelFromModelDef(modelDef: ModelDef, options?: CompileQueryOptions): ModelMaterializer;
|
|
72
|
+
/**
|
|
73
|
+
* Load a Malloy query by URL or contents.
|
|
74
|
+
*
|
|
75
|
+
* @param query The query URL or contents to load and (eventually) compile.
|
|
76
|
+
* @return A `QueryMaterializer` capable of materializing the requested query, running it,
|
|
77
|
+
* or loading further related objects.
|
|
78
|
+
*/
|
|
79
|
+
loadQuery(query: QueryURL | QueryString, options?: ParseOptions & CompileOptions & CompileQueryOptions): QueryMaterializer;
|
|
80
|
+
/**
|
|
81
|
+
* Load a Malloy query by the URL or contents of a Malloy model document
|
|
82
|
+
* and the index of an unnamed query contained in the model.
|
|
83
|
+
*
|
|
84
|
+
* @param model The model URL or contents to load and (eventually) compile to retrieve the requested query.
|
|
85
|
+
* @param index The index of the query to use within the model.
|
|
86
|
+
* @return A `QueryMaterializer` capable of materializing the requested query, running it,
|
|
87
|
+
* or loading further related objects.
|
|
88
|
+
*/
|
|
89
|
+
loadQueryByIndex(model: ModelURL | ModelString, index: number, options?: ParseOptions & CompileOptions & CompileQueryOptions): QueryMaterializer;
|
|
90
|
+
/**
|
|
91
|
+
* Load a Malloy query by the URL or contents of a Malloy model document
|
|
92
|
+
* and the name of a query contained in the model.
|
|
93
|
+
*
|
|
94
|
+
* @param model The model URL or contents to load and (eventually) compile to retrieve the requested query.
|
|
95
|
+
* @param name The name of the query to use within the model.
|
|
96
|
+
* @return A `QueryMaterializer` capable of materializing the requested query, running it,
|
|
97
|
+
* or loading further related objects.
|
|
98
|
+
*/
|
|
99
|
+
loadQueryByName(model: ModelURL | ModelString, name: string, options?: ParseOptions & CompileOptions & CompileQueryOptions): QueryMaterializer;
|
|
100
|
+
/**
|
|
101
|
+
* Compile a Malloy model by URL or contents.
|
|
102
|
+
*
|
|
103
|
+
* @param source The URL or contents of a Malloy model document to compile.
|
|
104
|
+
* @return A promise of a compiled `Model`.
|
|
105
|
+
*/
|
|
106
|
+
getModel(source: ModelURL | ModelString, options?: ParseOptions & CompileOptions): Promise<Model>;
|
|
107
|
+
/**
|
|
108
|
+
* Compile a Malloy query by URL or contents.
|
|
109
|
+
*
|
|
110
|
+
* @param query The URL or contents of a Malloy query document to compile.
|
|
111
|
+
* @return A promise of a compiled `PreparedQuery`.
|
|
112
|
+
*/
|
|
113
|
+
getQuery(query: QueryURL | QueryString, options?: ParseOptions & CompileOptions): Promise<PreparedQuery>;
|
|
114
|
+
/**
|
|
115
|
+
* Compile a Malloy query by the URL or contents of a model document
|
|
116
|
+
* and the index of an unnamed query contained within the model.
|
|
117
|
+
*
|
|
118
|
+
* @param model The URL or contents of a Malloy model document to compile.
|
|
119
|
+
* @param index The index of an unnamed query contained within the model.
|
|
120
|
+
* @return A promise of a compiled `PreparedQuery`.
|
|
121
|
+
*/
|
|
122
|
+
getQueryByIndex(model: ModelURL | ModelString, index: number, options?: ParseOptions & CompileOptions): Promise<PreparedQuery>;
|
|
123
|
+
/**
|
|
124
|
+
* Compile a Malloy query by the URL or contents of a model document
|
|
125
|
+
* and the name of a query contained within the model.
|
|
126
|
+
*
|
|
127
|
+
* @param model The URL or contents of a Malloy model document to compile.
|
|
128
|
+
* @param name The name of a query contained within the model.
|
|
129
|
+
* @return A promise of a compiled `PreparedQuery`.
|
|
130
|
+
*/
|
|
131
|
+
getQueryByName(model: ModelURL | ModelString, name: string, options?: ParseOptions & CompileOptions): Promise<PreparedQuery>;
|
|
132
|
+
}
|
|
133
|
+
export declare class ConnectionRuntime extends Runtime {
|
|
134
|
+
readonly rawConnections: Connection[];
|
|
135
|
+
constructor({ urlReader, connections, }: {
|
|
136
|
+
urlReader?: URLReader;
|
|
137
|
+
connections: Connection[];
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
export declare class SingleConnectionRuntime<T extends Connection = Connection> extends Runtime {
|
|
141
|
+
readonly connection: T;
|
|
142
|
+
constructor({ urlReader, connection, eventStream, cacheManager, }: {
|
|
143
|
+
urlReader?: URLReader;
|
|
144
|
+
eventStream?: EventStream;
|
|
145
|
+
cacheManager?: CacheManager;
|
|
146
|
+
connection: T;
|
|
147
|
+
});
|
|
148
|
+
get supportsNesting(): boolean;
|
|
149
|
+
quote(column: string): string;
|
|
150
|
+
get dialect(): Dialect;
|
|
151
|
+
getQuoter(): (arg: TemplateStringsArray) => string;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* An object representing the task of loading a `Model`, capable of
|
|
155
|
+
* materializing that model (via `getModel()`) or extending the task to load
|
|
156
|
+
* queries or explores (via e.g. `loadFinalQuery()`, `loadQuery`, `loadExploreByName`, etc.).
|
|
157
|
+
*/
|
|
158
|
+
export declare class ModelMaterializer extends FluentState<Model> {
|
|
159
|
+
protected runtime: Runtime;
|
|
160
|
+
private readonly compileQueryOptions;
|
|
161
|
+
constructor(runtime: Runtime, materialize: () => Promise<Model>, options?: CompileQueryOptions);
|
|
162
|
+
/**
|
|
163
|
+
* Load the final (unnamed) Malloy query contained within this loaded `Model`.
|
|
164
|
+
*
|
|
165
|
+
* @return A `QueryMaterializer` capable of materializing the requested query, running it,
|
|
166
|
+
* or loading further related objects.
|
|
167
|
+
*/
|
|
168
|
+
loadFinalQuery(options?: CompileQueryOptions): QueryMaterializer;
|
|
169
|
+
/**
|
|
170
|
+
* Load an unnamed query contained within this loaded `Model` by index.
|
|
171
|
+
*
|
|
172
|
+
* @param index The index of the query to load.
|
|
173
|
+
* @return A `QueryMaterializer` capable of materializing the requested query, running it,
|
|
174
|
+
* or loading further related objects.
|
|
175
|
+
*/
|
|
176
|
+
loadQueryByIndex(index: number, options?: CompileQueryOptions): QueryMaterializer;
|
|
177
|
+
/**
|
|
178
|
+
* Load a query contained within this loaded `Model` by its name.
|
|
179
|
+
*
|
|
180
|
+
* @param name The name of the query to load.
|
|
181
|
+
* @return A `QueryMaterializer` capable of materializing the requested query, running it,
|
|
182
|
+
* or loading further related objects.
|
|
183
|
+
*/
|
|
184
|
+
loadQueryByName(name: string, options?: CompileQueryOptions): QueryMaterializer;
|
|
185
|
+
/**
|
|
186
|
+
* Load a query against this loaded `Model` by its URL or contents.
|
|
187
|
+
*
|
|
188
|
+
* @param query The URL or contents of the query to load and (eventually) compile.
|
|
189
|
+
* @return A `QueryMaterializer` capable of materializing the requested query, running it,
|
|
190
|
+
* or loading further related objects.
|
|
191
|
+
*/
|
|
192
|
+
loadQuery(query: QueryString | QueryURL, options?: ParseOptions & CompileOptions & CompileQueryOptions): QueryMaterializer;
|
|
193
|
+
/**
|
|
194
|
+
* Extend a Malloy model by URL or contents.
|
|
195
|
+
*
|
|
196
|
+
* @param source The model URL or contents to load and (eventually) compile.
|
|
197
|
+
* @return A `ModelMaterializer` capable of materializing the requested model,
|
|
198
|
+
* or loading further related objects.
|
|
199
|
+
*/
|
|
200
|
+
extendModel(query: QueryString | QueryURL, options?: ParseOptions & CompileOptions & CompileQueryOptions): ModelMaterializer;
|
|
201
|
+
search(sourceName: string, searchTerm: string, limit?: number, searchField?: string | undefined): Promise<SearchIndexResult[] | undefined>;
|
|
202
|
+
searchValueMap(sourceName: string, limit?: number, options?: ParseOptions): Promise<SearchValueMapResult[] | undefined>;
|
|
203
|
+
/**
|
|
204
|
+
* Materialize the final query contained within this loaded `Model`.
|
|
205
|
+
*
|
|
206
|
+
* @return A promise to a prepared query.
|
|
207
|
+
*/
|
|
208
|
+
getFinalQuery(): Promise<PreparedQuery>;
|
|
209
|
+
/**
|
|
210
|
+
* Materialize an unnamed query contained within this loaded `Model` by index.
|
|
211
|
+
*
|
|
212
|
+
* @param index The index of the query contained within this loaded `Model`.
|
|
213
|
+
* @return A promise to a prepared query.
|
|
214
|
+
*/
|
|
215
|
+
getQueryByIndex(index: number): Promise<PreparedQuery>;
|
|
216
|
+
/**
|
|
217
|
+
* Materialize a query contained within this loaded `Model` by name.
|
|
218
|
+
*
|
|
219
|
+
* @param name The name of the query contained within this loaded `Model`.
|
|
220
|
+
* @return A promise to a prepared query.
|
|
221
|
+
*/
|
|
222
|
+
getQueryByName(name: string): Promise<PreparedQuery>;
|
|
223
|
+
/**
|
|
224
|
+
* Materialize a query against this loaded `Model` by its URL or contents.
|
|
225
|
+
*
|
|
226
|
+
* @param query The URL or contents of a query document to compile.
|
|
227
|
+
* @return A promise to a prepared query.
|
|
228
|
+
*/
|
|
229
|
+
getQuery(query: QueryString | QueryURL, options?: ParseOptions): Promise<PreparedQuery>;
|
|
230
|
+
_loadQueryFromQueryDef(query: InternalQuery, options?: CompileQueryOptions): QueryMaterializer;
|
|
231
|
+
/**
|
|
232
|
+
* Load an explore contained within this loaded `Model` by name.
|
|
233
|
+
*
|
|
234
|
+
* @param name The name of the explore contained within this loaded `Model`.
|
|
235
|
+
* @return An `ExploreMaterializer` capable of materializing the requested explore,
|
|
236
|
+
* or loading further related objects.
|
|
237
|
+
*/
|
|
238
|
+
loadExploreByName(name: string): ExploreMaterializer;
|
|
239
|
+
/**
|
|
240
|
+
* Materialize an explore contained within this loaded `Model` by its name.
|
|
241
|
+
*
|
|
242
|
+
* @param query The name of an explore within this loaded `Model`.
|
|
243
|
+
* @return A promise to an explore.
|
|
244
|
+
*/
|
|
245
|
+
getExploreByName(name: string): Promise<Explore>;
|
|
246
|
+
/**
|
|
247
|
+
* Compile and materialize this loaded `Model`.
|
|
248
|
+
*
|
|
249
|
+
* @return A promise to the compiled model that is loaded.
|
|
250
|
+
*/
|
|
251
|
+
getModel(): Promise<Model>;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* An object representing the task of loading a `Query`, capable of
|
|
255
|
+
* materializing the query (via `getPreparedQuery()`) or extending the task to load
|
|
256
|
+
* prepared results or run the query (via e.g. `loadPreparedResult()` or `run()`).
|
|
257
|
+
*/
|
|
258
|
+
export declare class QueryMaterializer extends FluentState<PreparedQuery> {
|
|
259
|
+
protected runtime: Runtime;
|
|
260
|
+
private readonly compileQueryOptions;
|
|
261
|
+
constructor(runtime: Runtime, materialize: () => Promise<PreparedQuery>, options?: CompileQueryOptions);
|
|
262
|
+
/**
|
|
263
|
+
* Run this loaded `Query`.
|
|
264
|
+
*
|
|
265
|
+
* @return The query results from running this loaded query.
|
|
266
|
+
*/
|
|
267
|
+
run(options?: RunSQLOptions & CompileQueryOptions): Promise<Result>;
|
|
268
|
+
runStream(options?: RunSQLOptions & CompileQueryOptions): AsyncIterableIterator<DataRecord>;
|
|
269
|
+
/**
|
|
270
|
+
* Load the prepared result of this loaded query.
|
|
271
|
+
*
|
|
272
|
+
* @return A `PreparedResultMaterializer` capable of materializing the requested
|
|
273
|
+
* prepared query or running it.
|
|
274
|
+
*/
|
|
275
|
+
loadPreparedResult(options?: CompileQueryOptions): PreparedResultMaterializer;
|
|
276
|
+
/**
|
|
277
|
+
* Materialize the prepared result of this loaded query.
|
|
278
|
+
*
|
|
279
|
+
* @return A promise of the prepared result of this loaded query.
|
|
280
|
+
*/
|
|
281
|
+
getPreparedResult(options?: CompileQueryOptions): Promise<PreparedResult>;
|
|
282
|
+
/**
|
|
283
|
+
* Materialize the SQL of this loaded query.
|
|
284
|
+
*
|
|
285
|
+
* @return A promise of the SQL string.
|
|
286
|
+
*/
|
|
287
|
+
getSQL(options?: CompileQueryOptions): Promise<string>;
|
|
288
|
+
/**
|
|
289
|
+
* Materialize this loaded query.
|
|
290
|
+
*
|
|
291
|
+
* @return A promise of the `PreparedQuery`.
|
|
292
|
+
*/
|
|
293
|
+
getPreparedQuery(): Promise<PreparedQuery>;
|
|
294
|
+
/**
|
|
295
|
+
* Estimates the cost of this loaded `Query`.
|
|
296
|
+
*
|
|
297
|
+
* @return The estimated cost of running this loaded query.
|
|
298
|
+
*/
|
|
299
|
+
estimateQueryCost(options?: CompileQueryOptions): Promise<QueryRunStats>;
|
|
300
|
+
get eventStream(): EventStream | undefined;
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* An object representing the task of loading a `PreparedResult`, capable of
|
|
304
|
+
* materializing the prepared result (via `getPreparedResult()`) or extending the task run
|
|
305
|
+
* the query.
|
|
306
|
+
*/
|
|
307
|
+
export declare class PreparedResultMaterializer extends FluentState<PreparedResult> {
|
|
308
|
+
/**
|
|
309
|
+
* Run this prepared result.
|
|
310
|
+
*
|
|
311
|
+
* @return A promise to the query result data.
|
|
312
|
+
*/
|
|
313
|
+
run(options?: RunSQLOptions): Promise<Result>;
|
|
314
|
+
runStream(options?: {
|
|
315
|
+
rowLimit?: number;
|
|
316
|
+
}): AsyncIterableIterator<DataRecord>;
|
|
317
|
+
/**
|
|
318
|
+
* Materialize this loaded prepared result.
|
|
319
|
+
*
|
|
320
|
+
* @return A promise of a prepared result.
|
|
321
|
+
*/
|
|
322
|
+
getPreparedResult(): Promise<PreparedResult>;
|
|
323
|
+
/**
|
|
324
|
+
* Materialize the SQL of this loaded prepared result.
|
|
325
|
+
*
|
|
326
|
+
* @return A promise to the SQL string.
|
|
327
|
+
*/
|
|
328
|
+
getSQL(): Promise<string>;
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* An object representing the task of loading an `Explore`, capable of
|
|
332
|
+
* materializing the explore (via `getExplore()`) or extending the task to produce
|
|
333
|
+
* related queries.
|
|
334
|
+
*/
|
|
335
|
+
export declare class ExploreMaterializer extends FluentState<Explore> {
|
|
336
|
+
protected runtime: Runtime;
|
|
337
|
+
private readonly compileQueryOptions;
|
|
338
|
+
constructor(runtime: Runtime, materialize: () => Promise<Explore>, options?: CompileQueryOptions);
|
|
339
|
+
/**
|
|
340
|
+
* Load a query contained within this loaded explore.
|
|
341
|
+
*
|
|
342
|
+
* @param name The name of the query to load.
|
|
343
|
+
* @return A `QueryMaterializer` capable of materializing the requested query, running it,
|
|
344
|
+
* or loading further related objects.
|
|
345
|
+
*/
|
|
346
|
+
loadQueryByName(name: string, options?: CompileQueryOptions): QueryMaterializer;
|
|
347
|
+
/**
|
|
348
|
+
* Materialize a query contained within this loaded explore.
|
|
349
|
+
*
|
|
350
|
+
* @param name The name of the query to materialize.
|
|
351
|
+
* @return A promise to the requested prepared query.
|
|
352
|
+
*/
|
|
353
|
+
getQueryByName(name: string): Promise<PreparedQuery>;
|
|
354
|
+
/**
|
|
355
|
+
* Materialize this loaded explore.
|
|
356
|
+
*
|
|
357
|
+
* @return A promise to the compiled `Explore`.
|
|
358
|
+
*/
|
|
359
|
+
getExplore(): Promise<Explore>;
|
|
360
|
+
}
|
|
361
|
+
export {};
|