.repos/effect-smol/packages/sql/pglite
| Name | Last commit message | Last commit date |
|---|---|---|
| .. | ||
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)
})