SYNC: charts auto detect

This commit is contained in:
Jan Prochazka
2025-07-02 15:49:10 +02:00
committed by Diflow
parent 6afd6d0aa0
commit ddf3c0810b
19 changed files with 450 additions and 1 deletions

View File

@@ -139,6 +139,19 @@ class Dumper extends SqlDumper {
this.endCommand();
}
}
putValue(value, dataType) {
const dataLower = dataType?.toLowerCase();
if (dataLower?.includes('date')) {
if (typeof value == 'string') {
this.putRaw("'");
this.putRaw(this.escapeString(value.replace(/(?:Z|[+-]\d{2}:?\d{2})$/, '')));
this.putRaw("'");
return;
}
}
super.putValue(value, dataType);
}
}
module.exports = Dumper;

View File

@@ -375,6 +375,11 @@ const mysqlDriverBase = {
}
return null;
},
adaptDataType(dataType) {
if (dataType?.toLowerCase() == 'money') return 'decimal(15,2)';
return dataType;
},
};
/** @type {import('dbgate-types').EngineDriver} */