DdbFlow
DynamoDB makes you write every field name three times: once in the expression, once in ExpressionAttributeNames, once in ExpressionAttributeValues. Miss one and the query breaks at runtime. The ORMs fix this by taking over your whole data layer with schemas and entities. DdbFlow takes the opposite bet: keep your own client, declare nothing, and just describe the operation in a fluent chain that hands back a plain params object. It sits in the gap between hand-writing attribute maps and adopting a 64 KB modeling framework.
# why i built this
After one too many runtime errors from a mismatched #attr placeholder, I wanted to describe what a DynamoDB operation should do, not how to format it, without migrating my code onto an ODM.
# key features
Chain key conditions, filters, projections, and update actions in one readable expression. ddbflow manages every placeholder and adds safe-create / safe-delete / optimistic-lock guards for you.
Outputs a plain params object for both the v2 DocumentClient and v3 @aws-sdk/lib-dynamodb. No adapter, no client wrapper, no dependency.
new DDBBuilder<User>('Users') checks field values against your model and autocompletes field names. Omit the type and it behaves like a plain JS builder.
# highlights
- No ORM, no schema, no lock-in: returns plain params for your own v2 or v3 client
- Opt-in entity typing: DDBBuilder<User> value-checks fields with zero runtime cost
- Typed access-pattern catalog: reusable parametrized queries via prepare / defineAccessPatterns
- put/get/del/update/query/scan plus batch, transactions, and a client-agnostic paginator
- Zero dependencies, ~5 KB min+gzip, ESM + CJS + full type declarations