Package

purescript-yoga-postgres

Repository
rowtype-yoga/purescript-yoga-postgres
License
MIT
Uploaded by
pacchettibotti
Published on
2026-02-16T23:42:08Z

Type-safe PureScript FFI bindings for PostgreSQL with typed query support.

Installation

spago install yoga-postgres yoga-sql-types
npm install pg

Usage

import Yoga.Postgres as PG
import Yoga.Postgres.TypedQuery as TQ

main = launchAff_ do
  conn <- PG.connect { connectionString: "postgresql://localhost/mydb" }
  
  -- Raw queries
  rows <- PG.query conn "SELECT * FROM users" []
  
  -- Typed queries
  result <- TQ.query conn 
    (TQ.sql @"SELECT id, name FROM users WHERE id = $id")
    { id: 123 }
  
  PG.disconnect conn

See yoga-postgres-om for Om-wrapped operations.

License

MIT

Modules
Yoga.Postgres
Yoga.Postgres.Schema
Yoga.Postgres.TypedQuery
Dependencies