Registry / database / bigchaindb-orm

bigchaindb-orm

JSON →
library3.0.3jsnpmunverified

A CRAB-based ORM for BigchainDB that maps blockchain operations (Create, Retrieve, Append, Burn) to familiar database CRUD patterns. Version 3.0.3 is the latest stable release with no active development since 2019. Uses the official BigchainDB JavaScript driver under the hood and provides model-based asset management with transaction history. Breaking changes in v3 modified storage namespacing, making it incompatible with data created by v2. Alternative to using the lower-level BigchainDB driver directly, offering a simpler abstraction for asset lifecycle operations.

npm install bigchaindb-orm
INSTALL
IMPORT
SIG · BIGCHAINDB-ORM
B
bigchaindb-orm
databasejavascriptv3.0.3
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'
import { Orm } from 'bigchaindb-orm'
Default export only; named import will fail.
bigchaindb-orm (CommonJS)
const Orm = require('bigchaindb-orm').default
const Orm = require('bigchaindb-orm')
Package uses ESM; CJS require() must access .default.
Ed25519Keypair
import Orm from 'bigchaindb-orm'; const keypair = new Orm.driver.Ed25519Keypair()
import { Ed25519Keypair } from 'bigchaindb-orm'
Ed25519Keypair is a nested property on the Orm instance (Orm.driver), not a direct export.

Initialize BigchainDB ORM, define a model, and create an asset with Ed25519 keys.

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: 'dataValue' } }).then(asset => { console.log(asset.id); });
Debug
Known issues
breakingVersion 3.x changes namespacing of data storage and retrieval. Using new version with old data will break it.
fix
Migrate data by re-creating assets under v3; backward incompatible with v2.
affects: >=3.0
deprecatedThe package has not seen updates since 2019 (BigchainDB itself is deprecated). Community suggests moving to alternative blockchain databases.
fix
Consider using a different blockchain storage solution (e.g., IPFS, traditional DB).
affects: >=0.0
gotchaCommonJS users must use require('bigchaindb-orm').default, not the result of require directly.
fix
Use const Orm = require('bigchaindb-orm').default;
affects: >=3.0
gotchaEd25519Keypair is accessed via bdbOrm.driver.Ed25519Keypair, not imported directly.
fix
Instantiate Orm first, then use new bdbOrm.driver.Ed25519Keypair().
affects: >=0.0
gotchaModel definition cannot be changed once set; define() throws if called twice on the same name.
fix
Define models only once during initialization.
affects: >=0.0
Errors
Common errors & fixes
Cannot find module 'bigchaindb-orm'
Package not installed or used in a non-Node environment.
fix
Install with `npm install bigchaindb-orm`. Ensure you are using Node.js and have a package.json.
export 'Orm' (imported as 'Orm') was not found in 'bigchaindb-orm'
Using named import `{ Orm }` instead of default import.
fix
Use `import Orm from 'bigchaindb-orm'`.
Orm is not a constructor
In CommonJS, directly using `require('bigchaindb-orm')` which returns an object with `default` property.
fix
Use `const Orm = require('bigchaindb-orm').default`.
bdbOrm.driver is undefined
Orm instance created without proper driver initialization, possibly due to invalid connection URL.
fix
Check that the BigchainDB node URL is correct and reachable. Use a testnet endpoint like 'https://test.bigchaindb.com/api/v1/'.
Upgrade
Version history
3.0.3latest on npm
Audit
Dependencies
bigchaindb-driverrequiredcore dependency for connecting to BigchainDB nodes
Agent activity
15 hits · last 30 days
node
12
OpenAI (training)
1
Resources
bigchaindb-orm — npm install bigchaindb-orm · libregistry