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

Function array

packages/sql/pg/src/PgTypes.ts:2586–2597  ·  view source on GitHub ↗
(
  values: ReadonlyArray<unknown> | null,
  elementOid: number,
  registry?: Registry
)

Source from the content-addressed store, hash-verified

2584 * @since 4.0.0
2585 */
2586export const array = (
2587 values: ReadonlyArray<unknown> | null,
2588 elementOid: number,
2589 registry?: Registry
2590): Result.Result<Parameter, CodecError> =>
2591 result(() => {
2592 const arrayOid = arrayOidFor(elementOid, registry)
2593 if (arrayOid === undefined) {
2594 return fail(`No array type known for element OID ${elementOid}`)
2595 }
2596 return makeParameter(arrayOid, values)
2597 })

Callers

nothing calls this directly

Calls 4

arrayOidForFunction · 0.85
resultFunction · 0.70
failFunction · 0.70
makeParameterFunction · 0.70

Tested by

no test coverage detected