editing MySQL binary fiellds

This commit is contained in:
Jan Prochazka
2021-10-17 10:52:10 +02:00
parent 2231bc21cd
commit 5bb9f181d8
5 changed files with 35 additions and 9 deletions

View File

@@ -1,4 +1,4 @@
const { SqlDumper, toHexString } = global.DBGATE_TOOLS;
const { SqlDumper, arrayToHexString } = global.DBGATE_TOOLS;
const _isArray = require('lodash/isArray');
class Dumper extends SqlDumper {
@@ -66,7 +66,7 @@ class Dumper extends SqlDumper {
}
putValue(value) {
if (value.type == 'Buffer' && _isArray(value.data)) this.putRaw(`unhex('${toHexString(value.data)}')`);
if (value.type == 'Buffer' && _isArray(value.data)) this.putRaw(`unhex('${arrayToHexString(value.data)}')`);
else super.putValue(value);
}
}