@malloydata/malloy 0.0.94-dev231018163737 → 0.0.94-dev231019135725
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.
|
@@ -366,7 +366,10 @@ class DuckDBDialect extends dialect_1.Dialect {
|
|
|
366
366
|
return malloyType.type;
|
|
367
367
|
}
|
|
368
368
|
sqlTypeToMalloyType(sqlType) {
|
|
369
|
-
|
|
369
|
+
var _a, _b;
|
|
370
|
+
// Remove trailing params
|
|
371
|
+
const baseSqlType = (_b = (_a = sqlType.match(/^(\w+)/)) === null || _a === void 0 ? void 0 : _a.at(0)) !== null && _b !== void 0 ? _b : sqlType;
|
|
372
|
+
return duckDBToMalloyTypes[baseSqlType.toUpperCase()];
|
|
370
373
|
}
|
|
371
374
|
castToString(expression) {
|
|
372
375
|
return `CAST(${expression} as VARCHAR)`;
|
|
@@ -71,6 +71,7 @@ const postgresToMalloyTypes = {
|
|
|
71
71
|
'numeric': { type: 'number', numberType: 'float' },
|
|
72
72
|
'bytea': { type: 'string' },
|
|
73
73
|
'pg_ndistinct': { type: 'number', numberType: 'integer' },
|
|
74
|
+
'varchar': { type: 'string' },
|
|
74
75
|
};
|
|
75
76
|
class PostgresDialect extends dialect_1.Dialect {
|
|
76
77
|
constructor() {
|
|
@@ -395,7 +396,10 @@ class PostgresDialect extends dialect_1.Dialect {
|
|
|
395
396
|
return malloyType.type;
|
|
396
397
|
}
|
|
397
398
|
sqlTypeToMalloyType(sqlType) {
|
|
398
|
-
|
|
399
|
+
var _a, _b;
|
|
400
|
+
// Remove trailing params
|
|
401
|
+
const baseSqlType = (_b = (_a = sqlType.match(/^(\w+)/)) === null || _a === void 0 ? void 0 : _a.at(0)) !== null && _b !== void 0 ? _b : sqlType;
|
|
402
|
+
return postgresToMalloyTypes[baseSqlType.toLowerCase()];
|
|
399
403
|
}
|
|
400
404
|
castToString(expression) {
|
|
401
405
|
return `CAST(${expression} as VARCHAR)`;
|
|
@@ -448,7 +448,10 @@ ${(0, utils_1.indent)(sql)}
|
|
|
448
448
|
return malloyType.type;
|
|
449
449
|
}
|
|
450
450
|
sqlTypeToMalloyType(sqlType) {
|
|
451
|
-
|
|
451
|
+
var _a, _b;
|
|
452
|
+
// Remove trailing params
|
|
453
|
+
const baseSqlType = (_b = (_a = sqlType.match(/^(\w+)/)) === null || _a === void 0 ? void 0 : _a.at(0)) !== null && _b !== void 0 ? _b : sqlType;
|
|
454
|
+
return bqToMalloyTypes[baseSqlType.toUpperCase()];
|
|
452
455
|
}
|
|
453
456
|
castToString(expression) {
|
|
454
457
|
return `CAST(${expression} as STRING)`;
|