Registry / database / fruit-postgresql

fruit-postgresql

JSON →
library0.0.6jsnpmunverified

Fruit-postgresql is the PostgreSQL adapter for the Fruit ORM (v0.0.6, experimental). It provides basic database connectivity for PostgreSQL using the pg npm package. The project appears to be in early development with minimal documentation and no recent updates (last publish 2015). Compared to mature ORMs like Sequelize or TypeORM, it is not recommended for production use due to lack of maintenance.

npm install fruit-postgresql
INSTALL
IMPORT
SIG · FRUIT-POSTGRESQL
F
fruit-postgresql
databasejavascriptv0.0.6
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.

Fruit
import { Fruit } from 'fruit'
const Fruit = require('fruit-object');
The adapter is not imported directly; you import Fruit from 'fruit' and pass postgresql options.
Fruit (require)
const Fruit = require('fruit');
const fruit = require('fruit-postgresql');
CommonJS: require('fruit') gets the ORM; then configure with pg adapter options.
default export
import Fruit from 'fruit'
import { Fruit } from 'fruit-postgresql'
Export from 'fruit' is default; the adapter is not directly exported.

Initializes Fruit ORM with PostgreSQL adapter, defines a model, syncs schema, and inserts a record.

const Fruit = require('fruit'); const db = new Fruit({ adapter: 'postgresql', host: process.env.PGHOST || 'localhost', database: process.env.PGDATABASE || 'mydb', user: process.env.PGUSER || 'user', password: process.env.PGPASSWORD || '' }); db.define('User', { id: { type: 'serial', key: true }, name: { type: 'text' } }); db.sync().then(() => { return db.model('User').create({ name: 'John' }); }).then(user => { console.log(user); }).catch(err => { console.error(err); });
Debug
Known issues
deprecatedPackage is unmaintained since 2015.
fix
Use a modern ORM like Sequelize or TypeORM instead.
affects: >=0.0.0
gotchaAdapter is experimental; API may change.
fix
Pin to exact version and monitor upstream.
affects: 0.0.0
gotchaRequires 'fruit' core package to be installed separately.
fix
Run `npm install fruit fruit-postgresql`.
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module 'fruit'
Missing core ORM dependency.
fix
Install fruit: npm install fruit
Cannot read property 'define' of undefined
Forgot to call new Fruit() or misconfigured adapter.
fix
Ensure you create a new Fruit instance with correct adapter options.
Error: connect ECONNREFUSED
PostgreSQL server not running or wrong host/port.
fix
Start PostgreSQL and verify connection options.
Upgrade
Version history
0.0.6latest on npm
Audit
Dependencies
fruitrequiredCore ORM package required
Agent activity
5 hits · last 30 days
node
4
Resources
fruit-postgresql — npm install fruit-postgresql · libregistry