@malloydata/malloy 0.0.118-dev240111234914 → 0.0.118
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/index.d.ts +2 -2
- package/dist/index.js +3 -1
- package/dist/malloy.d.ts +5 -0
- package/dist/malloy.js +7 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ export type { QueryDataRow, Fragment, StructDef, StructRelationship, NamedStruct
|
|
|
4
4
|
export { Segment, isFilteredAliasedName, isSamplingEnable, isSamplingPercent, isSamplingRows, mkExpr, expressionIsCalculation, indent, } from './model';
|
|
5
5
|
export { HighlightType, MalloyTranslator, } from './lang';
|
|
6
6
|
export type { LogMessage, TranslateResponse } from './lang';
|
|
7
|
-
export { Malloy, Runtime, AtomicFieldType, ConnectionRuntime, SingleConnectionRuntime, EmptyURLReader, InMemoryURLReader, FixedConnectionMap, MalloyError, JoinRelationship, SourceRelationship, DateTimeframe, TimestampTimeframe, Result, QueryMaterializer, CSVWriter, JSONWriter, Parse, DataWriter, Explore, } from './malloy';
|
|
8
|
-
export type { Model, PreparedQuery,
|
|
7
|
+
export { Malloy, Runtime, AtomicFieldType, ConnectionRuntime, SingleConnectionRuntime, EmptyURLReader, InMemoryURLReader, FixedConnectionMap, MalloyError, JoinRelationship, SourceRelationship, DateTimeframe, TimestampTimeframe, PreparedResult, Result, QueryMaterializer, CSVWriter, JSONWriter, Parse, DataWriter, Explore, } from './malloy';
|
|
8
|
+
export type { Model, PreparedQuery, Field, AtomicField, ExploreField, QueryField, SortableField, DataArray, DataRecord, DataColumn, DataArrayOrRecord, Loggable, ModelMaterializer, DocumentSymbol, DocumentHighlight, ResultJSON, PreparedResultMaterializer, SQLBlockMaterializer, ExploreMaterializer, WriteStream, SerializedExplore, } from './malloy';
|
|
9
9
|
export type { RunSQLOptions } from './run_sql_options';
|
|
10
10
|
export type { Connection, ConnectionConfig, ConnectionFactory, ConnectionParameter, ConnectionParameterValue, ConnectionConfigSchema, InfoConnection, LookupConnection, ModelString, ModelURL, FetchSchemaOptions, PersistSQLResults, PooledConnection, QueryString, QueryURL, TestableConnection, StreamingConnection, URLReader, } from './runtime_types';
|
|
11
11
|
export { toAsyncGenerator } from './connection_utils';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.toAsyncGenerator = exports.Explore = exports.DataWriter = exports.Parse = exports.JSONWriter = exports.CSVWriter = exports.QueryMaterializer = exports.Result = exports.PreparedResult = exports.TimestampTimeframe = exports.DateTimeframe = exports.SourceRelationship = exports.JoinRelationship = exports.MalloyError = exports.FixedConnectionMap = exports.InMemoryURLReader = exports.EmptyURLReader = exports.SingleConnectionRuntime = exports.ConnectionRuntime = exports.AtomicFieldType = exports.Runtime = exports.Malloy = exports.MalloyTranslator = exports.HighlightType = exports.indent = exports.expressionIsCalculation = exports.mkExpr = exports.isSamplingRows = exports.isSamplingPercent = exports.isSamplingEnable = exports.isFilteredAliasedName = exports.Segment = exports.FUNCTIONS = exports.Dialect = exports.spread = exports.param = exports.sqlFragment = exports.makeParam = exports.sql = exports.maxScalar = exports.minAggregate = exports.anyExprType = exports.minScalar = exports.overload = exports.qtz = exports.arg = exports.registerDialect = exports.PostgresDialect = exports.StandardSQLDialect = exports.DuckDBDialect = void 0;
|
|
4
|
+
exports.Tag = void 0;
|
|
4
5
|
/*
|
|
5
6
|
* Copyright 2023 Google LLC
|
|
6
7
|
*
|
|
@@ -71,6 +72,7 @@ Object.defineProperty(exports, "JoinRelationship", { enumerable: true, get: func
|
|
|
71
72
|
Object.defineProperty(exports, "SourceRelationship", { enumerable: true, get: function () { return malloy_1.SourceRelationship; } });
|
|
72
73
|
Object.defineProperty(exports, "DateTimeframe", { enumerable: true, get: function () { return malloy_1.DateTimeframe; } });
|
|
73
74
|
Object.defineProperty(exports, "TimestampTimeframe", { enumerable: true, get: function () { return malloy_1.TimestampTimeframe; } });
|
|
75
|
+
Object.defineProperty(exports, "PreparedResult", { enumerable: true, get: function () { return malloy_1.PreparedResult; } });
|
|
74
76
|
Object.defineProperty(exports, "Result", { enumerable: true, get: function () { return malloy_1.Result; } });
|
|
75
77
|
Object.defineProperty(exports, "QueryMaterializer", { enumerable: true, get: function () { return malloy_1.QueryMaterializer; } });
|
|
76
78
|
Object.defineProperty(exports, "CSVWriter", { enumerable: true, get: function () { return malloy_1.CSVWriter; } });
|
package/dist/malloy.d.ts
CHANGED
|
@@ -423,6 +423,10 @@ export declare class DocumentCompletion {
|
|
|
423
423
|
readonly text: string;
|
|
424
424
|
constructor(completion: DocumentCompletionDefinition);
|
|
425
425
|
}
|
|
426
|
+
export type PreparedResultJSON = {
|
|
427
|
+
query: CompiledQuery;
|
|
428
|
+
modelDef: ModelDef;
|
|
429
|
+
};
|
|
426
430
|
/**
|
|
427
431
|
* A fully-prepared query containing SQL and metadata required to run the query.
|
|
428
432
|
*/
|
|
@@ -430,6 +434,7 @@ export declare class PreparedResult implements Taggable {
|
|
|
430
434
|
protected modelDef: ModelDef;
|
|
431
435
|
protected inner: CompiledQuery;
|
|
432
436
|
constructor(query: CompiledQuery, modelDef: ModelDef);
|
|
437
|
+
static fromJson({ query, modelDef, }: PreparedResultJSON): PreparedResult;
|
|
433
438
|
tagParse(spec?: TagParseSpec): TagParse;
|
|
434
439
|
getTaglines(prefix?: RegExp): string[];
|
|
435
440
|
get annotation(): Annotation | undefined;
|
package/dist/malloy.js
CHANGED
|
@@ -739,6 +739,13 @@ class PreparedResult {
|
|
|
739
739
|
this.modelDef = modelDef;
|
|
740
740
|
this.inner = query;
|
|
741
741
|
}
|
|
742
|
+
static fromJson({ query, modelDef, }) {
|
|
743
|
+
// Validate extracted properties (optional, but recommended)
|
|
744
|
+
if (!query || !modelDef) {
|
|
745
|
+
throw new Error('Missing required properties in JSON data');
|
|
746
|
+
}
|
|
747
|
+
return new PreparedResult(query, modelDef);
|
|
748
|
+
}
|
|
742
749
|
tagParse(spec) {
|
|
743
750
|
const modelScope = tags_1.Tag.annotationToTag(this.modelDef.annotation).tag;
|
|
744
751
|
spec = tags_1.Tag.addModelScope(spec, modelScope);
|