MCPcopy Create free account
hub / github.com/bytebase/bytebase / extractSQLRowValueRaw

Function extractSQLRowValueRaw

frontend/src/utils/v1/sql.ts:429–442  ·  view source on GitHub ↗
(value: RowValue | undefined)

Source from the content-addressed store, hash-verified

427
428// extractSQLRowValueRaw extracts a raw value from a RowValue.
429const extractSQLRowValueRaw = (value: RowValue | undefined) => {
430 if (typeof value === "undefined" || value.kind?.case === "nullValue") {
431 return null;
432 }
433 const j = toJson(RowValueSchema, value);
434 if (j === null) {
435 return undefined;
436 }
437 const keys = Object.keys(j);
438 if (keys.length === 0) {
439 return undefined;
440 }
441 return value.kind?.value;
442};
443
444const toInt = (a: unknown) => {
445 return typeof a === "number"

Callers 1

compareQueryRowValuesFunction · 0.85

Calls 1

keysMethod · 0.80

Tested by

no test coverage detected