fix: map datatype to lowerase variants in firebird

This commit is contained in:
Pavel
2025-05-29 10:23:26 +02:00
parent f7ca64a49d
commit 2c5c58dc90

View File

@@ -1,47 +1,47 @@
function getDataTypeString({ dataTypeCode, scale, length, precision }) { function getDataTypeString({ dataTypeCode, scale, length, precision }) {
switch (dataTypeCode) { switch (dataTypeCode) {
case 7: case 7:
return 'SMALLINT'; return 'smallint';
case 8: case 8:
return 'INTEGER'; return 'integer';
case 9: case 9:
return 'BIGINT'; return 'bigint';
case 10: case 10:
return 'FLOAT'; return 'float';
case 11: case 11:
return 'DOUBLE PRECISION'; return 'DOUBLE precision';
case 12: case 12:
return 'DATE'; return 'date';
case 13: case 13:
return 'TIME'; return 'time';
case 14: case 14:
return `CHAR(${length})`; return `char(${length})`;
case 16: case 16:
return `DECIMAL(${precision}, ${scale})`; return `decimal(${precision}, ${scale})`;
case 27: case 27:
return 'DOUBLE PRECISION'; return 'double precision';
case 35: case 35:
return 'BLOB'; return 'blob';
case 37: case 37:
return `VARCHAR(${length})`; return `varchar(${length})`;
case 261: case 261:
return 'CSTRING'; return 'cstring';
default: default:
if (dataTypeCode === null || dataTypeCode === undefined) return 'UNKNOWN'; if (dataTypeCode === null || dataTypeCode === undefined) return 'UNKNOWN';
return `UNKNOWN (${dataTypeCode})`; return `unknown (${dataTypeCode})`;
} }
} }