Registry / database / js-driver-bdb-orm

js-driver-bdb-orm

JSON →
library0.0.7jsnpmunverified

A CRAB (Create, Retrieve, Append, Burn) based ORM for BigchainDB, version 0.0.7. This library provides a higher-level abstraction over the BigchainDB JavaScript driver, enabling developers to define models and perform CRUD-like operations on a blockchain. It is a fork of the original bigchaindb-js driver, maintained independently. The package does not appear to be actively maintained, with the last version released around 2018. It relies on the official BigchainDB driver for connection and keypair generation.

npm install js-driver-bdb-orm
INSTALL
IMPORT
SIG · JS-DRIVER-BDB-ORM
J
js-driver-bdb-orm
databasejavascriptv0.0.7
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.

Orm
import Orm from 'bigchaindb-orm'
const Orm = require('bigchaindb-orm'); // Missing default import; CJS require may not work if package is ESM-only
ESM-only; use default import. CJS require may fail due to lack of module.exports.
Orm
import Orm from 'bigchaindb-orm'
No named export; only default export.
bdbOrm.driver.Ed25519Keypair
import Orm from 'bigchaindb-orm'; const keypair = new Orm.driver.Ed25519Keypair()
Cannot import Ed25519Keypair directly; must access via Orm.driver
Key generation is through the driver instance, not a separate import.

Initialize ORM, define a model, create a keypair, and create an asset on BigchainDB testnet.

import Orm from 'bigchaindb-orm' const bdbOrm = new Orm( 'https://test.bigchaindb.com/api/v1/', { app_id: process.env.APP_ID ?? '', app_key: process.env.APP_KEY ?? '' } ) bdbOrm.define('myModel', 'https://schema.org/v1/myModel') const aliceKeypair = new bdbOrm.driver.Ed25519Keypair() bdbOrm.models.myModel .create({ keypair: aliceKeypair, data: { key: 'value' } }) .then(asset => { console.log('Asset ID:', asset.id) }) .catch(err => console.error(err))
Debug
Known issues
gotchaThe package is a fork may not be maintained; use original bigchaindb-orm or bigchaindb-driver directly.
fix
Switch to 'bigchaindb-orm' (official) or 'bigchaindb-driver' for up-to-date support.
affects: >=0.0.0
gotchaThe ORM uses CRAB (Create, Retrieve, Append, Burn) which differs from standard CRUD: update becomes append, delete becomes burn.
fix
Understand that 'update' appends a new transaction, and 'delete' burns the asset.
affects: >=0.0.0
breakingThe model name defined with bdbOrm.define cannot be changed after definition.
fix
Define the model name correctly at startup; it's immutable.
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module 'bigchaindb-orm'
Package not installed or installed under wrong name (fork version uses 'bigchaindb-orm' but npm package name is 'js-driver-bdb-orm')
fix
Install package with correct name: npm install js-driver-bdb-orm
Orm is not a constructor
Using a named import instead of default import
fix
Use import Orm from 'js-driver-bdb-orm' (default import) instead of import { Orm } from '...'
Unrecognized property: app_id
Constructor expects options object, but app_id may be incorrect property name (should be 'app_id'?)
fix
Check BigchainDB driver docs; use 'app_id' and 'app_key' as shown in README.
bdbOrm.models.myModel.create is not a function
Model not defined with define() before use
fix
Call bdbOrm.define('myModel', ...) before accessing bdbOrm.models.myModel
Upgrade
Version history
0.0.7latest on npm
Audit
Dependencies
bigchaindb-driverrequiredCore dependency for connecting to BigchainDB nodes, creating keypairs, and performing transactions.
Agent activity
30 hits · last 30 days
node
24
Amazon
1
OpenAI (training)
1
Resources
js-driver-bdb-orm — npm install js-driver-bdb-orm · libregistry