Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: handle timestamp in sql results (#13911)

boojack3ba784686025
diff --git a/frontend/package.json b/frontend/package.json
index f2b7da31a2..e96d6039d7 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -33,7 +33,7 @@
"canvas-confetti": "1.9.3",
"crypto-js": "^4.2.0",
"d3-shape": "^3.2.0",
- "dayjs": "1.11.11",
+ "dayjs": "1.11.13",
"dompurify": "3.1.6",
"downloadjs": "1.4.7",
"elkjs": "^0.9.1",
diff --git a/frontend/pnpm-lock.yaml b/frontend/pnpm-lock.yaml
index cba2f04fc4..00b5c3b653 100644
--- a/frontend/pnpm-lock.yaml
+++ b/frontend/pnpm-lock.yaml
@@ -48,8 +48,8 @@ importers:
specifier: ^3.2.0
version: 3.2.0
dayjs:
- specifier: 1.11.11
- version: 1.11.11
+ specifier: 1.11.13
+ version: 1.11.13
dompurify:
specifier: 3.1.6
version: 3.1.6
@@ -1996,8 +1996,8 @@ packages:
resolution: {integrity: sha512-fRHTG8g/Gif+kSh50gaGEdToemgfj74aRX3swtiouboip5JDLAyDE9F11nHMIcvOaXeOC6D7SpNhi7uFyB7Uww==}
- resolution: {integrity: sha512-okzr3f11N6WuqYtZSvm+F776mB41wRZMhKP+hc34YdW+KmtYYK9iqvHSwo2k9FEH3fhGXvOPV6yz2IcSrfRUDg==}
+ resolution: {integrity: sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==}
resolution: {integrity: sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==}
@@ -5867,7 +5867,7 @@ snapshots:
diff --git a/frontend/src/utils/v1/sql.ts b/frontend/src/utils/v1/sql.ts
index 4f2d8b0bc4..f423314f83 100644
--- a/frontend/src/utils/v1/sql.ts
+++ b/frontend/src/utils/v1/sql.ts
@@ -50,10 +50,17 @@ export const extractSQLRowValue = (
}
if (value.timestampValue) {
const timestampValue = value.timestampValue;
+ const fullDayjs = dayjs(getDateForPbTimestamp(timestampValue));
+ const microseconds = Math.floor(timestampValue.nanos / 1000);
+ const timezoneOffset = fullDayjs.format("Z");
+ const formattedTimestamp =
+ microseconds > 0
+ ? `${fullDayjs.format("YYYY-MM-DDTHH:mm:ss")}.${microseconds.toString().padStart(6, "0")}${timezoneOffset}`
+ : `${fullDayjs.format("YYYY-MM-DDTHH:mm:ss")}${timezoneOffset}`;
+
return {
- plain: dayjs(getDateForPbTimestamp(timestampValue)).format(
- "YYYY-MM-DDTHH:mm:ss.SSSZ"
- ),
+ // Use the conditionally formatted timestamp
+ plain: formattedTimestamp,
raw: timestampValue,
};
}