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

Function writeValue

packages/sql/pg/src/PgTypes.ts:2182–2186  ·  view source on GitHub ↗
(sink: ValueSink, value: unknown, oid: number, lookup: Lookup)

Source from the content-addressed store, hash-verified

2180 parameter.value === null ? Result.succeed(null) : encode(parameter.value, parameter.oid, registry)
2181
2182const writeValue = (sink: ValueSink, value: unknown, oid: number, lookup: Lookup): void => {
2183 const codec = requireCodec(oid, lookup)
2184 if (codec.write === undefined) sink.raw(codec.encode(value))
2185 else codec.write(sink, value)
2186}
2187
2188/**
2189 * Returns whether a parameter uses the text format in a `Bind` message.

Callers 3

writeArrayFunction · 0.85
writeFramedFunction · 0.85
writeParameterUnsafeFunction · 0.85

Calls 4

requireCodecFunction · 0.85
encodeMethod · 0.80
writeMethod · 0.65
rawMethod · 0.45

Tested by

no test coverage detected