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

Function makeArrayCodec

packages/sql/pg/src/PgTypes.ts:1506–1511  ·  view source on GitHub ↗
(elementOid: number, lookup: Lookup)

Source from the content-addressed store, hash-verified

1504]
1505
1506const makeArrayCodec = (elementOid: number, lookup: Lookup): UnsafeCodec<ReadonlyArray<unknown>> =>
1507 codecOf(
1508 (bytes, offset, size) => decodeArray(bytes, offset, size, elementOid, lookup),
1509 (value) => encodeArray(value, elementOid, lookup),
1510 (sink, value) => writeArray(sink, value, elementOid, lookup)
1511 )
1512
1513const makeRangeCodec = (subtypeOid: number, lookup: Lookup): UnsafeCodec<Range<unknown>> =>
1514 codecOf(

Callers 2

makeBuiltinsFunction · 0.85
registerInStateFunction · 0.85

Calls 4

writeArrayFunction · 0.85
codecOfFunction · 0.70
decodeArrayFunction · 0.70
encodeArrayFunction · 0.70

Tested by

no test coverage detected