@malloydata/malloy 0.0.22-dev230117200639 → 0.0.22-dev230117223957

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.
@@ -21,9 +21,6 @@
21
21
  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
22
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
23
  */
24
- var __importDefault = (this && this.__importDefault) || function (mod) {
25
- return (mod && mod.__esModule) ? mod : { "default": mod };
26
- };
27
24
  Object.defineProperty(exports, "__esModule", { value: true });
28
25
  exports.flattenQuery = exports.QueryModel = exports.Segment = void 0;
29
26
  const lodash_1 = require("lodash");
@@ -31,7 +28,6 @@ const standardsql_1 = require("../dialect/standardsql");
31
28
  const dialect_1 = require("../dialect");
32
29
  const malloy_types_1 = require("./malloy_types");
33
30
  const utils_1 = require("./utils");
34
- const md5_1 = __importDefault(require("md5"));
35
31
  // quote a string for SQL use. Perhaps should be in dialect.
36
32
  function generateSQLStringLiteral(sourceString) {
37
33
  return `'${sourceString}'`;
@@ -80,7 +76,7 @@ class StageWriter {
80
76
  }
81
77
  addPDT(baseName, dialect) {
82
78
  const sql = this.combineStages(false).sql + this.withs[this.withs.length - 1];
83
- const tableName = "scratch." + baseName + (0, md5_1.default)(sql);
79
+ const tableName = "scratch." + baseName + (0, utils_1.generateHash)(sql);
84
80
  this.root().pdts.push(dialect.sqlCreateTableAsSelect(tableName, sql));
85
81
  return tableName;
86
82
  }
@@ -21,13 +21,10 @@
21
21
  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
22
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
23
  */
24
- var __importDefault = (this && this.__importDefault) || function (mod) {
25
- return (mod && mod.__esModule) ? mod : { "default": mod };
26
- };
27
24
  Object.defineProperty(exports, "__esModule", { value: true });
28
25
  exports.makeSQLBlock = void 0;
29
26
  const malloy_types_1 = require("./malloy_types");
30
- const md5_1 = __importDefault(require("md5"));
27
+ const utils_1 = require("./utils");
31
28
  /**
32
29
  * The factory for SQLBlocks. Exists because the name is computed
33
30
  * from the components of the block and that name needs to be
@@ -54,6 +51,6 @@ exports.makeSQLBlock = makeSQLBlock;
54
51
  // algorithm needs to change
55
52
  function nameFor(select) {
56
53
  const phrases = select.map((el) => (0, malloy_types_1.isSQLFragment)(el) ? el.sql : JSON.stringify(el));
57
- return (0, md5_1.default)(phrases.join(";"));
54
+ return (0, utils_1.generateHash)(phrases.join(";"));
58
55
  }
59
56
  //# sourceMappingURL=sql_block.js.map
@@ -19,3 +19,4 @@ export declare class AndChain {
19
19
  sqlOr(): string;
20
20
  sql(whereOrHaving?: "where" | "having"): string;
21
21
  }
22
+ export declare function generateHash(input: string): string;
@@ -21,8 +21,12 @@
21
21
  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
22
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
23
  */
24
+ var __importDefault = (this && this.__importDefault) || function (mod) {
25
+ return (mod && mod.__esModule) ? mod : { "default": mod };
26
+ };
24
27
  Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.AndChain = exports.generateSQLStringLiteral = exports.indent = void 0;
28
+ exports.generateHash = exports.AndChain = exports.generateSQLStringLiteral = exports.indent = void 0;
29
+ const md5_1 = __importDefault(require("md5"));
26
30
  /** simple indent function */
27
31
  function indent(s) {
28
32
  const re = /(^|\n)/g;
@@ -91,4 +95,8 @@ class AndChain {
91
95
  }
92
96
  }
93
97
  exports.AndChain = AndChain;
98
+ function generateHash(input) {
99
+ return (0, md5_1.default)(input);
100
+ }
101
+ exports.generateHash = generateHash;
94
102
  //# sourceMappingURL=utils.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/malloy",
3
- "version": "0.0.22-dev230117200639",
3
+ "version": "0.0.22-dev230117223957",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",