bigint support #1087

This commit is contained in:
SPRINX0\prochazka
2025-05-05 16:04:21 +02:00
parent 23db345756
commit 110d87e512
11 changed files with 93 additions and 15 deletions

View File

@@ -54,7 +54,8 @@
$: style = computeStyle(maxWidth, col);
$: isJson = _.isPlainObject(value) && !(value?.type == 'Buffer' && _.isArray(value.data)) && !value.$oid;
$: isJson =
_.isPlainObject(value) && !(value?.type == 'Buffer' && _.isArray(value.data)) && !value.$oid && !value.$bigint;
// don't parse JSON for explicit data types
$: jsonParsedValue = !editorTypes?.explicitDataType && isJsonLikeLongString(value) ? safeJsonParse(value) : null;

View File

@@ -72,6 +72,7 @@ export function countColumnSizes(grider: Grider, columns, containerWidth, displa
let text = value;
if (_.isArray(value)) text = `[${value.length} items]`;
else if (value?.$oid) text = `ObjectId("${value.$oid}")`;
else if (value?.$bigint) text = value.$bigint;
else if (isJsonLikeLongString(value) && safeJsonParse(value)) text = '(JSON)';
const width = context.measureText(text).width + 8;
// console.log('colName', colName, text, width);

View File

@@ -13,6 +13,7 @@ import { callServerPing } from './connectionsPinger';
import { batchDispatchCacheTriggers, dispatchCacheChange } from './cache';
import { isAdminPage, isOneOfPage } from './pageDefs';
import { openWebLink } from './simpleTools';
import { serializeJsTypesReplacer } from 'dbgate-tools';
export const strmid = uuidv1();
@@ -177,7 +178,7 @@ export async function apiCall(
'Content-Type': 'application/json',
...resolveApiHeaders(),
},
body: JSON.stringify(args),
body: JSON.stringify(args, serializeJsTypesReplacer),
});
if (resp.status == 401 && !apiDisabled) {