Skip to content
Source
Sign inSign up
pingdotgg/t3code

.repos/effect-smol/packages/sql/pglite

Contents of .repos/effect-smol/packages/sql/pglite
NameLast commit messageLast commit date
..
src (directory)
test (directory)
CHANGELOG.md
LICENSE
package.json
README.md
tsconfig.json

README.md

@effect/sql-pglite

An Effect SQL client for PGlite, a WASM build of PostgreSQL that runs in the browser, Node.js, and Bun.

Installation

npm install effect@rc @effect/sql-pglite@rc

LISTEN / NOTIFY

listen is a scoped subscription that returns after the listener is installed. It exposes notifications through a queue and keeps the subscription active for the surrounding scope:

import { PgliteClient } from "@effect/sql-pglite"
import { Effect, Queue } from "effect"

const program = Effect.gen(function*() {
  const sql = yield* PgliteClient.PgliteClient
  const notifications = yield* sql.listen("events")

  yield* sql.notify("events", "ready")
  return yield* Queue.take(notifications)
})

Documentation