DynamoDB Eloquent is a TypeScript ORM for Amazon DynamoDB, inspired by Laravel Eloquent. Current stable version is 1.0.21, released as a single initial version. It provides a familiar ActiveRecord-style interface for DynamoDB operations including CRUD, filtering, scanning, pagination, and migrations. Key differentiators: simple repository pattern, automatic index mapping, built-in migration system, and support for secondary indexes with sorting. It runs in Node.js and supports both JavaScript and TypeScript.
npm install dynamodb-eloquentNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates how to define a repository class extending DynamoDBRepository and perform basic CRUD operations.
Ensure mappingIndex includes each GSI name used in queries.
Always pass the GSI name as second argument to findBy/findOneBy.
Use userRepo.delete('id-value') not userRepo.delete({id: 'id-value'}).Use scanDataV2 instead of scanData.
Set AWS_REGION, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, or AWS_PROFILE in environment.
Pass the primary key value (e.g., id) as a string to delete() or include 'id' in update params.
Ensure key values match table schema (string vs number) and include sort key if defined.
Verify the GSI name exists in AWS console or create it, and update mappingIndex accordingly.
Add the scripts as shown in documentation and ensure the package is installed.