0.0.13 • Published 1 year ago

effect-supabase v0.0.13

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

effect-supabase

An Effect wrapper for the Supabase sdk.

Database queries

Queries are inspired by and hope to be as complete as those provided by sqlfx.

import { Supabase } from "effect-supabase";
import { Schema } from "@effect/schema";

const EventId = Schema.Int.pipe(Schema.brand(""EventId));

const Event = Schema.Struct({
  starts: Schema.Date
});

export const getEventById = (id: EventId) =>
  Effect.flatMap(Supabase, (sb) =>
    Supabase.resolver("getEventById", {
        result: Event,
        request: EventId,
 run: (ids) => sb.client.from("events").select("*").in("id", ids)
    }).execute(id)
  ).pipe(Effect.withSpan("getEventById", { attributes: { id } }));
0.0.11

1 year ago

0.0.12

1 year ago

0.0.13

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago