mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-22 23:56:00 +00:00
#182 support for MySQL binary keys
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
import _ from 'lodash';
|
||||
import { toHexString } from 'dbgate-tools';
|
||||
|
||||
export function copyTextToClipboard(text) {
|
||||
const oldFocus = document.activeElement;
|
||||
|
||||
@@ -58,3 +61,13 @@ export function copyTextToClipboard(text) {
|
||||
|
||||
if (oldFocus) oldFocus.focus();
|
||||
}
|
||||
|
||||
export function extractRowCopiedValue(row, col) {
|
||||
let value = row[col];
|
||||
if (value === undefined) value = _.get(row, col);
|
||||
if (value === null) return '(NULL)';
|
||||
if (value === undefined) return '(NoField)';
|
||||
if (value.type == 'Buffer' && _.isArray(value.data)) return toHexString(value.data);
|
||||
if (_.isPlainObject(value) || _.isArray(value)) return JSON.stringify(value);
|
||||
return value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user