Registry / database / bs-postgres-effects

bs-postgres-effects

JSON →
library0.3.0jsnpmunverified

Bucklescript effect bindings for bs-postgres, version 0.3.0. Provides a purescript-style effect wrapper for postgres operations in BuckleScript (now ReScript). This package is thin and likely unmaintained; the last release was in 2018. It wraps the bs-postgres library, not the npm 'pg' package directly. Users should consider migrating to ReScript-native PostgreSQL libraries or using raw bindings. No active development or releases expected.

npm install bs-postgres-effects
INSTALL
IMPORT
SIG · BS-POSTGRES-EFFECT
B
bs-postgres-effects
databasejavascriptv0.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Pg
import { Pg } from 'bs-postgres-effects'
var Pg = require('bs-postgres-effects').Pg
BuckleScript modules use ES-style imports.
query
import { query } from 'bs-postgres-effects'
Named export for query effect.
connect
import { connect } from 'bs-postgres-effects'
import * as pg from 'bs-postgres-effects'
Default import is not supported; only named exports.

Demonstrates basic usage of bs-postgres-effects with effect wrapper and query.

// Ensure bs-postgres and bs-postgres-effects are installed // Sample usage with BuckleScript (now ReScript) // This assumes a bsconfig.json with "bs-postgres-effects" in bs-dependencies open BsPostgresEffects; let myQuery = query("SELECT * FROM users WHERE id = ?", [1]); myQuery |> Pg.effect |> runEffect; // runEffect would be from a Monad library or effect runner // Note: Actual usage depends on having an effect runner (like purescript-aff or a custom one).
Debug
Known issues
deprecatedPackage has not been updated since 2018. Consider using ReScript-native PostgreSQL bindings or direct bs-postgres.
fix
Migrate to rescript-postgres or raw bs-postgres.
affects: >=0.0.0
gotchaThis package wraps bs-postgres, not the npm 'pg' package. Ensure you have bs-postgres as a dependency.
fix
Install bs-postgres alongside bs-postgres-effects.
affects: >=0.0.0
gotchaEffect syntax is non-standard in JavaScript/TypeScript; requires a purescript-style effect system (e.g., Monad libraries).
fix
Use a library like 'purescript-effects' or write custom runner.
affects: >=0.0.0
breakingBuckleScript compiler evolved into ReScript; this package uses old BS syntax (e.g., open).
fix
Convert to ReScript syntax or keep using old BS compiler.
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module 'bs-postgres-effects'
Package not installed or not in bsconfig.json dependencies.
fix
Run 'npm install bs-postgres-effects' and add to bsconfig's bs-dependencies.
Module 'bs-postgres-effects' has no export 'Pg'
Incorrect import path; trying to import from wrong package.
fix
Check that you are using the matching version and correct export name.
This expression has type 'unit' but an expression was expected of type 'Js.promise('a)'
Trying to use effect result without proper effect runner.
fix
Wrap the effect with a runner like 'runAff' from a Monad library.
Upgrade
Version history
0.3.0latest on npm
Audit
Dependencies
bs-postgresrequiredDirect dependency for postgres bindings
Agent activity
23 hits · last 30 days
node
20
OpenAI (training)
1
Resources
bs-postgres-effects — npm install bs-postgres-effects · libregistry