Registry / database / dynamite-orm

dynamite-orm

JSON →
library2.1.0jsnpmunverified

A TypeScript ORM for Amazon DynamoDB, version 2.1.0, with built-in support for models, CRUD operations, global secondary index queries, soft delete/recover, and automatic timestamps. Released under MIT license, maintained actively. Differentiates from other DynamoDB ORMs by providing a class-based model pattern with entity definitions, easy GSI queries, and soft delete functionality out of the box. Ships TypeScript definitions.

npm install dynamite-orm
INSTALL
IMPORT
SIG · DYNAMITE-ORM
D
dynamite-orm
databasejavascriptv2.1.0
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.

BaseModel
import { BaseModel } from 'dynamite-orm'
Base class for defining document models. Use with IModel interface.
Entity
import { Entity } from 'dynamite-orm'
Class for creating entity instances tied to a DynamoDB table.
IModel
import { IModel } from 'dynamite-orm'
const { IModel } = require('dynamite-orm')
Interface for model data, includes id, created_at, updated_at fields.

Defines a User model and entity, then inserts a document and logs the result with auto-generated fields.

import { BaseModel, IModel, Entity } from 'dynamite-orm'; interface IUser extends IModel { username: string; age: number; user_email: string; } class UserModel extends BaseModel implements IUser { constructor(data?: Partial<IUser>) { super(); Object.assign(this, data); } public username!: string; public age!: number; public user_email!: string; } type IndexOptions = 'UsernameIndex' | 'UserEmailIndex'; class UserEntity extends Entity<IndexOptions, IUser> { constructor(tableName: string) { super(tableName); } } const User = new UserEntity('UserTableName'); async function example() { const { Attributes } = await User.Insert({ username: 'FooBar', age: 18, user_email: 'foo@bar.com' }); const user = new UserModel(Attributes); console.log(user.toJSON()); }
Debug
Known issues
gotchaSoft delete sets is_deleted flag and does not remove item; hard delete permanently removes regardless of is_deleted.
fix
Review business logic: use SoftDelete when you need recoverability, HardDelete for permanent removal.
affects: >=2.0.0
deprecatedUsing aws-sdk v2 (dynamodb) is deprecated; use @aws-sdk/client-dynamodb v3 instead.
fix
Install @aws-sdk/client-dynamodb and configure SDK client accordingly.
affects: >=2.0.0
gotchaEntity constructor requires table name; providing incorrect name leads to runtime errors.
fix
Double-check table name matches DynamoDB resource.
affects: >=1.0.0
gotchaFindOne expects primary key (id) as object; passing string will cause query failure.
fix
Always pass { id: '...' } to FindOne.
affects: >=2.0.0
deprecatedRequire-style import not supported; package is ESM-only (exports TypeScript).
fix
Use ES import syntax.
affects: >=2.0.0
Errors
Common errors & fixes
TypeError: Class extends value undefined is not a constructor or null
Missing or incorrect import of BaseModel.
fix
Ensure import { BaseModel } from 'dynamite-orm' is correct.
Entity is not a constructor
Importing Entity as default instead of named export.
fix
Use import { Entity } from 'dynamite-orm'.
The specified key does not exist in the DynamoDB table
Wrong partition key or table name.
fix
Verify table name in Entity constructor and primary key spelling.
Upgrade
Version history
2.1.0latest on npm
Audit
Dependencies
aws-sdkoptionalDynamoDB client
@aws-sdk/client-dynamodboptionalModular AWS SDK v3 client for DynamoDB
Agent activity
2 hits · last 30 days
node
2
Resources
dynamite-orm — npm install dynamite-orm · libregistry