@malloydata/malloy 0.0.366 → 0.0.367
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/lang/ast/statements/define-source.js +5 -3
- package/dist/model/malloy_types.d.ts +1 -0
- package/dist/model/persist_utils.d.ts +8 -0
- package/dist/model/persist_utils.js +1 -0
- package/dist/model/query_query.js +2 -2
- package/dist/model/source_def_utils.js +2 -0
- package/dist/model/sql_compiled.js +2 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -4
|
@@ -25,6 +25,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
25
25
|
exports.DefineSourceList = exports.DefineSource = void 0;
|
|
26
26
|
const malloy_types_1 = require("../../../model/malloy_types");
|
|
27
27
|
const source_def_utils_1 = require("../../../model/source_def_utils");
|
|
28
|
+
const persist_utils_1 = require("../../../model/persist_utils");
|
|
28
29
|
const error_factory_1 = require("../error-factory");
|
|
29
30
|
const malloy_element_1 = require("../types/malloy-element");
|
|
30
31
|
const noteable_1 = require("../types/noteable");
|
|
@@ -67,14 +68,15 @@ class DefineSource extends malloy_element_1.MalloyElement {
|
|
|
67
68
|
as: this.name,
|
|
68
69
|
location: this.location,
|
|
69
70
|
};
|
|
70
|
-
if ((0, malloy_types_1.isPersistableSourceDef)(entry)) {
|
|
71
|
-
entry.sourceID = (0, source_def_utils_1.mkSourceID)(this.name, (_b = this.location) === null || _b === void 0 ? void 0 : _b.url);
|
|
72
|
-
}
|
|
73
71
|
if (this.note) {
|
|
74
72
|
entry.annotation = structDef.annotation
|
|
75
73
|
? { ...this.note, inherits: structDef.annotation }
|
|
76
74
|
: this.note;
|
|
77
75
|
}
|
|
76
|
+
if ((0, malloy_types_1.isPersistableSourceDef)(entry)) {
|
|
77
|
+
entry.sourceID = (0, source_def_utils_1.mkSourceID)(this.name, (_b = this.location) === null || _b === void 0 ? void 0 : _b.url);
|
|
78
|
+
entry.persistent = (0, persist_utils_1.checkPersistAnnotation)(entry).persist;
|
|
79
|
+
}
|
|
78
80
|
entry.partitionComposite =
|
|
79
81
|
(_d = (0, composite_source_utils_1.getPartitionCompositeDesc)(this.note, structDef, (_c = this.sourceExpr) !== null && _c !== void 0 ? _c : this)) !== null && _d !== void 0 ? _d : structDef.partitionComposite;
|
|
80
82
|
doc.setEntry(this.name, { entry, exported: this.exported });
|
|
@@ -767,6 +767,7 @@ export declare function isSourceRegistryReference(entry: SourceRegistryEntry): e
|
|
|
767
767
|
export interface PersistableSourceProperties {
|
|
768
768
|
sourceID?: SourceID;
|
|
769
769
|
extends?: SourceID;
|
|
770
|
+
persistent?: boolean;
|
|
770
771
|
}
|
|
771
772
|
export interface SQLSourceDef extends SourceDefBase, PersistableSourceProperties {
|
|
772
773
|
type: 'sql_select';
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import type { ModelDef, SourceDef, Query } from './malloy_types';
|
|
2
2
|
import type { LogMessage } from '../lang';
|
|
3
3
|
import type { BuildNode } from '../api/foundation/types';
|
|
4
|
+
/**
|
|
5
|
+
* Check if a source has the #@ persist annotation.
|
|
6
|
+
* Returns both the persist flag and any tag parse errors.
|
|
7
|
+
*/
|
|
8
|
+
export declare function checkPersistAnnotation(source: SourceDef): {
|
|
9
|
+
persist: boolean;
|
|
10
|
+
log: LogMessage[];
|
|
11
|
+
};
|
|
4
12
|
/**
|
|
5
13
|
* Find persistent dependencies for a source or query, returning a nested DAG.
|
|
6
14
|
*
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: MIT
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.checkPersistAnnotation = checkPersistAnnotation;
|
|
7
8
|
exports.findPersistentDependencies = findPersistentDependencies;
|
|
8
9
|
exports.minimalBuildGraph = minimalBuildGraph;
|
|
9
10
|
const malloy_types_1 = require("./malloy_types");
|
|
@@ -542,8 +542,8 @@ class QueryQuery extends query_node_1.QueryField {
|
|
|
542
542
|
return qs.structDef.pipeSQL;
|
|
543
543
|
case 'query_source': {
|
|
544
544
|
const { buildManifest, connectionDigests } = (_d = qs.prepareResultOptions) !== null && _d !== void 0 ? _d : {};
|
|
545
|
-
// Check manifest for this source
|
|
546
|
-
if (buildManifest && connectionDigests) {
|
|
545
|
+
// Check manifest for this source (only if it was marked persistent at definition time)
|
|
546
|
+
if (buildManifest && connectionDigests && qs.structDef.persistent) {
|
|
547
547
|
const connDigest = (0, malloy_types_1.safeRecordGet)(connectionDigests, qs.structDef.connection);
|
|
548
548
|
if (connDigest) {
|
|
549
549
|
// Compile with empty opts to get manifest-ignorant SQL for BuildID
|
|
@@ -59,6 +59,7 @@ function mkQuerySourceDef(base, query, name) {
|
|
|
59
59
|
// PersistableSourceProperties - explicitly NOT copied
|
|
60
60
|
// sourceID: undefined,
|
|
61
61
|
// extends: undefined,
|
|
62
|
+
// persistent: undefined,
|
|
62
63
|
};
|
|
63
64
|
}
|
|
64
65
|
/**
|
|
@@ -97,6 +98,7 @@ function mkSQLSourceDef(base, selectStr, selectSegments) {
|
|
|
97
98
|
// PersistableSourceProperties - explicitly NOT copied
|
|
98
99
|
// sourceID: undefined,
|
|
99
100
|
// extends: undefined,
|
|
101
|
+
// persistent: undefined,
|
|
100
102
|
};
|
|
101
103
|
}
|
|
102
104
|
/**
|
|
@@ -52,8 +52,8 @@ function expandSegment(segment, opts, quoteTablePath, compileQuery) {
|
|
|
52
52
|
*/
|
|
53
53
|
function expandPersistableSource(source, opts, quoteTablePath, compileQuery) {
|
|
54
54
|
const { buildManifest, connectionDigests } = opts;
|
|
55
|
-
// Try manifest lookup if we have the required info
|
|
56
|
-
if (buildManifest && connectionDigests) {
|
|
55
|
+
// Try manifest lookup if we have the required info (only for persistent sources)
|
|
56
|
+
if (buildManifest && connectionDigests && source.persistent) {
|
|
57
57
|
const connDigest = (0, malloy_types_1.safeRecordGet)(connectionDigests, source.connection);
|
|
58
58
|
if (connDigest) {
|
|
59
59
|
// Get the SQL for this source to compute BuildID (no opts = full SQL)
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const MALLOY_VERSION = "0.0.
|
|
1
|
+
export declare const MALLOY_VERSION = "0.0.367";
|
package/dist/version.js
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MALLOY_VERSION = void 0;
|
|
4
4
|
// generated with 'generate-version-file' script; do not edit manually
|
|
5
|
-
exports.MALLOY_VERSION = '0.0.
|
|
5
|
+
exports.MALLOY_VERSION = '0.0.367';
|
|
6
6
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@malloydata/malloy",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.367",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dist/index.js",
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
"generate-version-file": "VERSION=$(npm pkg get version --workspaces=false | tr -d \\\")\necho \"// generated with 'generate-version-file' script; do not edit manually\\nexport const MALLOY_VERSION = '$VERSION';\" > src/version.ts"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@malloydata/malloy-filter": "0.0.
|
|
51
|
-
"@malloydata/malloy-interfaces": "0.0.
|
|
52
|
-
"@malloydata/malloy-tag": "0.0.
|
|
50
|
+
"@malloydata/malloy-filter": "0.0.367",
|
|
51
|
+
"@malloydata/malloy-interfaces": "0.0.367",
|
|
52
|
+
"@malloydata/malloy-tag": "0.0.367",
|
|
53
53
|
"@noble/hashes": "^1.8.0",
|
|
54
54
|
"antlr4ts": "^0.5.0-alpha.4",
|
|
55
55
|
"assert": "^2.0.0",
|