npm.io
1.0.0-rc.13 • Published 3d ago

@distilled.cloud/planetscale

Licence
Apache-2.0
Version
1.0.0-rc.13
Deps
1
Size
3.2 MB
Vulns
0
Weekly
0
Stars
428

@distilled.cloud/planetscale

Effect-native SDK for planetscale.

Installation

npm install @distilled.cloud/planetscale effect

Quick start

import { Effect, Layer } from "effect";
import * as FetchHttpClient from "effect/http/FetchHttpClient";
import * as PlanetScale from "@distilled.cloud/planetscale";

const program = Effect.gen(function* () {
  const result = yield* PlanetScale.listDatabases({ organization: "acme" });
  return result;
});

const Live = Layer.mergeAll(
  FetchHttpClient.layer,
  PlanetScale.CredentialsFromEnv,
  PlanetScale.PlanetScaleProtocol,
);

program.pipe(Effect.provide(Live), Effect.runPromise);

Auth

Required: PLANETSCALE_API_TOKEN, PLANETSCALE_API_TOKEN_ID, PLANETSCALE_ORGANIZATION. Sent as Authorization: Bearer.