DEEP Database Library (deep-db)

raw JSON →
1.12.25 verified Sat Apr 25 auth: no javascript maintenance

deep-db is the database module of the DEEP Framework, an enterprise-level cloud-native framework for building serverless applications on AWS. Version 1.12.25 is part of the deep-framework monorepo, which has seen active maintenance up to v1.12.46, with updates focused on AWS region support, bug fixes, and Node.js compatibility (v4.3+ to v6.x). It provides abstracted database operations over AWS DynamoDB, offering find, get, and partition management features. Uniquely, it is tightly integrated with the DEEP ecosystem, requiring the deepify CLI tool for deployment and local development. This library is not intended for standalone use outside the DEEP framework and is largely dependent on other DEEP modules and AWS services. Alternatives include direct use of AWS SDK DynamoDB client or other DynamoDB abstraction layers like Dynamoose or document client.

error TypeError: Cannot read property 'find' of undefined
cause Database instance not properly instantiated or import is wrong (e.g., default import used instead of named).
fix
Ensure you use const { Database } = require('deep-db') and then instantiate with new Database(options).
error Error: The level of configuration is invalid: 1
cause Connection to AWS failed due to missing or incorrect credentials.
fix
Check your AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables, or pass them in the constructor options.
error deepify: command not found
cause deepify CLI not installed globally.
fix
Run npm install deepify -g and ensure it is in your PATH.
deprecated deep-db is part of the DEEP framework which is in maintenance mode. Active development has shifted to other platforms.
fix Consider migrating to AWS SDK v3 DocumentClient or Dynamoose for new projects.
gotcha deep-db requires the deepify CLI tool for deployment and local development; it cannot be used standalone.
fix Install deepify globally: npm install deepify -g. Then use deepify server for local testing.
breaking Node.js v6.x migration in v1.12.31 dropped support for Node.js v4.x. Older versions may not work on new AWS Lambda Node.js runtimes.
fix Update to deep-framework >=1.12.31 and use Node.js >=6.x.
gotcha deep-db is only compatible with AWS DynamoDB; no support for other databases.
fix If you need multi-cloud support, consider using a different abstraction layer like Sails.js or LoopBack.
npm install deep-db
yarn add deep-db
pnpm add deep-db

Instantiate a Database object and perform a simple find query on a DynamoDB table called 'Users'.

const { Database } = require('deep-db');
const db = new Database({
  region: process.env.AWS_REGION ?? 'us-east-1',
  accessKeyId: process.env.AWS_ACCESS_KEY_ID ?? '',
  secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY ?? ''
});
db.find('Users', { name: 'Alice' })
  .then(data => console.log(JSON.stringify(data)))
  .catch(err => console.error(err));