MCPcopy
hub / github.com/Effect-TS/effect / findAll

Function findAll

packages/sql/src/SqlSchema.ts:16–30  ·  view source on GitHub ↗
(
  options: {
    readonly Request: Schema.Schema<IA, II, IR>
    readonly Result: Schema.Schema<A, AI, AR>
    readonly execute: (request: II) => Effect.Effect<ReadonlyArray<unknown>, E, R>
  }
)

Source from the content-addressed store, hash-verified

14 * @category constructor
15 */
16export const findAll = <IR, II, IA, AR, AI, A, R, E>(
17 options: {
18 readonly Request: Schema.Schema<IA, II, IR>
19 readonly Result: Schema.Schema<A, AI, AR>
20 readonly execute: (request: II) => Effect.Effect<ReadonlyArray<unknown>, E, R>
21 }
22) => {
23 const encodeRequest = Schema.encode(options.Request)
24 const decode = Schema.decodeUnknown(Schema.Array(options.Result))
25 return (request: IA): Effect.Effect<ReadonlyArray<A>, E | ParseError, R | IR | AR> =>
26 Effect.flatMap(
27 Effect.flatMap(encodeRequest(request), options.execute),
28 decode
29 )
30}
31
32const void_ = <IR, II, IA, R, E>(
33 options: {

Callers

nothing calls this directly

Calls 1

encodeMethod · 0.80

Tested by

no test coverage detected