Registry /
database / jugglingdb-postgres-atlassian
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.
Schema
✓ var Schema = require('jugglingdb').Schema;
✗ import { Schema } from 'jugglingdb';
CommonJS only; no ESM support.
schema instance
✓ var schema = new Schema('postgres-atlassian', options);
✗ var schema = new Schema('postgres', options);
Must use exactly 'postgres-atlassian' as adapter name.
define method
✓ var Model = schema.define('Model', {col: {type: Number}});
✗ var Model = schema.define('Model', {col: Number});
Column type must be object with type property, not shorthand.
Shows how to connect, define a model with a float field, auto-upgrade schema, and create a record.
var Schema = require('jugglingdb').Schema;
var schema = new Schema('postgres-atlassian', {
database: process.env.PGDATABASE || 'myapp_test',
username: process.env.PGUSER || 'postgres',
password: process.env.PGPASSWORD || '',
host: process.env.PGHOST || 'localhost',
port: parseInt(process.env.PGPORT, 10) || 5432
});
var Post = schema.define('Post', {
title: { type: String, length: 255 },
content: { type: String },
rating: { type: Number, dataType: 'float' }
});
schema.autoupgrade(function(err) {
if (err) { console.error(err); return; }
Post.create({title: 'Hello', content: 'World', rating: 4.5}, function(err, post) {
console.log(post);
});
});
Errors
Common errors & fixes
Error: Cannot find module 'jugglingdb'
jugglingdb not installed or wrong version
fixnpm install jugglingdb@0.2.x
Error: Schema requires jugglingdb >= 0.2.0
Installed jugglingdb version too old
fixnpm install jugglingdb@0.2.x
TypeError: Cannot read property 'define' of undefined
Adapter not registered; schema creation failed
fixEnsure 'postgres-atlassian' is spelled correctly and package is installed.
Upgrade
Version history
0.1.0-atlassian-003latest on npm
Audit
Dependencies
jugglingdbrequiredPeer dependency required at version 0.2.x