-
Notifications
You must be signed in to change notification settings - Fork 0
Adapter
Eugene Lazutkin edited this page Apr 23, 2026
·
34 revisions
See also (AWS JS SDK v3):
DynamoDBDocumentClient· SDK Command pages linked from each sub-page. Vocabulary: Concepts.
Adapter is the toolkit's composition root. One Adapter typically maps to one logical entity (often one table). It owns long-lived state (client, table, keyFields, searchable, indirectIndices, hooks) and delegates real work to orthogonal sub-modules.
import {Adapter} from 'dynamodb-toolkit';
const adapter = new Adapter({
client: docClient,
table: 'planets',
keyFields: ['name']
});| Section | Content |
|---|---|
| Adapter: Constructor options | Required + optional constructor fields |
| Adapter: CRUD methods |
getByKey, getByKeys, getList, getListByParams, post, put, patch, delete, clone, move
|
| Adapter: Mass methods |
putItems, deleteByKeys, deleteListByParams, cloneByKeys, cloneListByParams, moveByKeys, moveListByParams
|
| Adapter: Batch builders |
makeGet, makeCheck, makePost, makePut, makePatch, makeDelete
|
| Adapter: Hooks |
prepare, prepareKey, prepareListInput, updateInput, revive, validateItem, checkConsistency
|
| Adapter: Raw marker | The Raw<T> bypass marker + raw(item) helper |
| Adapter: Indirect indices | Sparse GSI second-hop reads |
| Adapter: Transaction auto-upgrade | When checkConsistency returns extra checks |
The Adapter is a convenience layer. If you only want a slice of the toolkit:
import {applyBatch, applyTransaction, getBatch} from 'dynamodb-toolkit/batch';
import {paginateList, iterateItems} from 'dynamodb-toolkit/mass';
import {buildUpdate, addProjection, buildSearch} from 'dynamodb-toolkit/expressions';
import {getPath, setPath, applyPatch} from 'dynamodb-toolkit/paths';These sub-exports work standalone and don't require an Adapter instance.
Start here
- Getting started
- Concepts
- Key and field design
- Compatibility
- Migration: v2 to v3
- SDK v2 to v3 cheat sheet
Guides
- Hierarchical data walkthrough
- Key expression patterns
- Multi-type tables
- Pagination
- Mass operation semantics
- URL schema design
Adapter
- Adapter
- Constructor options
- CRUD methods
- Mass methods
- Batch builders
- Hooks
- Raw marker
- Indirect indices
- Transaction auto-upgrade
Expression builders
Batch / transactions / mass / paths
REST surface
Framework adapters
Recipes
- Recipes index
- List records of a tier
- Per-tier sparse GSI markers
- Tier within a partition
- Reservation with auto-release
- Keys-only GSI, runtime projection
- Cascade subtree operations
- Querying subtrees with buildKey
- Filter URL grammar
- Text search
- Provisioning workflow
- Resumable mass operations
History