MCPcopy Create free account
hub / github.com/Effect-TS/effect / readTimeMicros

Function readTimeMicros

packages/sql/pg/src/PgTypes.ts:1106–1113  ·  view source on GitHub ↗
(bytes: Uint8Array, offset: number)

Source from the content-addressed store, hash-verified

1104 * nonsense time.
1105 */
1106const readTimeMicros = (bytes: Uint8Array, offset: number): number => {
1107 const high = readInt32(bytes, offset)
1108 const micros = high * 4294967296 + readUint32(bytes, offset + 4)
1109 if (high < 0 || micros > MAX_TIME_MICROS_NUMBER) {
1110 return fail(`timetz out of range: ${micros}`)
1111 }
1112 return micros
1113}
1114
1115let timestampHigh = 0
1116let timestampLow = 0

Callers 1

PgTypes.tsFile · 0.85

Calls 3

readInt32Function · 0.85
readUint32Function · 0.85
failFunction · 0.70

Tested by

no test coverage detected