Generator-based, co/koa compatible utility for accessing PostgreSQL. Version 0.4.0 is the current release (last updated circa 2016). Provides a simple DAO layer with schema introspection, upsert, and query execution using yieldable generators. Designed for use with Koa/co-style coroutines. Not suitable for modern async/await or ESM environments. Limited to Node >=4.2.0. Deprecated in favor of modern ORMs like Prisma, Sequelize, or TypeORM.
npm install rain-util-postgresNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Connects to PostgreSQL, creates a table, inserts a record using upsert, then retrieves it via DAO findOne, all using generator co-routines.
Migrate to a modern PostgreSQL client like pg with async/await, or use an ORM like Sequelize, Prisma, or TypeORM.
Use an async/await library instead, or run with a wrapper that provides generator support.
Use require() or switch to an ESM-compatible package.
Always call $postgres.table(tablename) for each table you intend to use.
Ensure each table has a primary key and that all columns are supported by the upsert logic.
Write your own type declarations or use a TypeScript-first library.
Use const $Postgres = require('rain-util-postgres');Install co: npm i co and wrap code in co(function*(){ ... }).Add $postgres.table('users'); before accessing $postgres.tables.users.Ensure PostgreSQL is running and host/port are correct.