@malloydata/malloy 0.0.196 → 0.0.197-dev241009193540

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.
@@ -36,10 +36,6 @@ const dialect_1 = require("../dialect");
36
36
  const functions_1 = require("../functions");
37
37
  const dialect_functions_1 = require("./dialect_functions");
38
38
  const function_overrides_1 = require("./function_overrides");
39
- const castMap = {
40
- number: 'double precision',
41
- string: 'varchar(255)',
42
- };
43
39
  const msExtractionMap = {
44
40
  day_of_week: 'DAYOFWEEK',
45
41
  day_of_year: 'DAYOFYEAR',
@@ -106,15 +102,16 @@ class MySQLDialect extends dialect_1.Dialect {
106
102
  this.supportsArraysInData = false;
107
103
  }
108
104
  malloyTypeToSQLType(malloyType) {
109
- if (malloyType.type === 'number') {
110
- if (malloyType.numberType === 'integer') {
111
- return 'BIGINT';
112
- }
113
- else {
114
- return 'DOUBLE';
115
- }
105
+ switch (malloyType.type) {
106
+ case 'number':
107
+ return malloyType.numberType === 'integer' ? 'BIGINT' : 'DOUBLE';
108
+ case 'string':
109
+ return 'CHAR';
110
+ case 'date':
111
+ case 'timestamp':
112
+ default:
113
+ return malloyType.type;
116
114
  }
117
- return malloyType.type;
118
115
  }
119
116
  sqlTypeToMalloyType(sqlType) {
120
117
  var _a, _b;
@@ -354,7 +351,7 @@ class MySQLDialect extends dialect_1.Dialect {
354
351
  }
355
352
  if (cast.srcType !== cast.dstType) {
356
353
  const dstType = typeof cast.dstType === 'string'
357
- ? castMap[cast.dstType]
354
+ ? this.malloyTypeToSQLType({ type: cast.dstType })
358
355
  : cast.dstType.raw;
359
356
  if (cast.safe) {
360
357
  throw new Error("Mysql dialect doesn't support Safe Cast");
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const MALLOY_VERSION = "0.0.196";
1
+ export declare const MALLOY_VERSION = "0.0.197";
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.196';
5
+ exports.MALLOY_VERSION = '0.0.197';
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.196",
3
+ "version": "0.0.197-dev241009193540",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",