@malloydata/malloy 0.0.13-dev221205155228 → 0.0.13

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.
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ // Generated from Malloy.g4 by ANTLR 4.9.0-SNAPSHOT
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=MalloyVisitor.js.map
@@ -1174,6 +1174,22 @@ describe("sql:", () => {
1174
1174
  expect(where).toEqual({ sql: " WHERE 1=1" });
1175
1175
  }
1176
1176
  });
1177
+ it("model preserved", () => {
1178
+ const selStmt = "SELECT * FROM aTable";
1179
+ const shouldBeOK = `
1180
+ source: newa is a
1181
+ sql: someSql is { select: """${selStmt}""" }
1182
+ source: newaa is newa
1183
+ `;
1184
+ const model = new BetaModel(shouldBeOK);
1185
+ expect(model).modelParsed();
1186
+ const needReq = model.translate();
1187
+ const needs = needReq === null || needReq === void 0 ? void 0 : needReq.compileSQL;
1188
+ expect(needs).toBeDefined();
1189
+ const sql = (0, sql_block_1.makeSQLBlock)([{ sql: selStmt }]);
1190
+ model.update({ compileSQL: { [sql.name]: makeSchemaResponse(sql) } });
1191
+ expect(model).modelCompiled();
1192
+ });
1177
1193
  });
1178
1194
  describe("error handling", () => {
1179
1195
  test("field and query with same name does not overflow", () => {
package/dist/md5.d.ts ADDED
@@ -0,0 +1 @@
1
+ export declare const md5: (val: string) => string;
package/dist/md5.js ADDED
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.md5 = void 0;
27
+ const crypto = __importStar(require("crypto"));
28
+ const md5 = (val) => crypto.createHash("md5").update(val).digest("hex");
29
+ exports.md5 = md5;
30
+ //# sourceMappingURL=md5.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/malloy",
3
- "version": "0.0.13-dev221205155228",
3
+ "version": "0.0.13",
4
4
  "license": "GPL-2.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",