Electrodb
A DynamoDB library to ease the use of modeling complex hierarchical relationships and implementing a Single Table Design while keeping your query code readable.
Install / Use
/learn @tywalch/ElectrodbREADME
ElectroDB

ElectroDB is a DynamoDB library to ease the use of having multiple entities and complex hierarchical relationships in a single DynamoDB table.
Please submit issues/feedback or reach out on Twitter @tinkertamper.
<a href="https://electrodb.dev/en/core-concepts/v3-migration/"><h1 align="center">ElectroDB v3 now released</h1></a>
<p align="center">Visit the <a href="https://electrodb.dev/en/core-concepts/v3-migration/">v3 migration page</a> to learn more about this new update.</p><a href="https://electrodb.dev"><h1 align="center">Documentation now found at ElectroDB.dev</h1></a>
<p align="center">ElectroDB's new website for Documentation is now live at <a href="https://electrodb.dev">electrodb.dev</a>.</p><a href="https://electrodb.fun"><h1 align="center">The NEW ElectroDB Playground</h1></a>
<p align="center"> <a href="https://electrodb.fun"><img width="400" src="https://github.com/tywalch/electrodb/blob/master/assets/playground.jpg?raw=true"></a> </p> <p align="center">Try out and share ElectroDB Models, Services, and Single Table Design at <a href="https://electrodb.fun">electrodb.fun</a></p>Features
- Single-Table Entity Isolation - Entities created with ElectroDB will not conflict with other entities when using a single DynamoDB table.
- Attribute Schema Enforcement - Define a schema for your entities with enforced attribute validation, defaults, types, aliases, and more.
- Easily Compose Hierarchical Access Patterns - Plan and design hierarchical keys for your indexes to multiply your possible access patterns.
- Simplified Sort Key Condition Querying - Write efficient sort key queries by easily building compose keys.
- Simplified Filter Composition - Easily create complex readable filters for DynamoDB queries without worrying about the implementation of
ExpressionAttributeNames,ExpressionAttributeValues, andFilterExpressions. - Simplified Condition Composition - Use the same interface to casily create complex readable mutation conditions for DynamoDB queries without worrying about the implementation of
ExpressionAttributeNames,ExpressionAttributeValues, andConditionExpressions. - Simplified Update Expression Composition - Easily compose type safe update operations without having to format tedious
ExpressionAttributeNames,ExpressionAttributeValues, andUpdateExpressions. - Easily Query Across Entities - Define "collections" to create powerful/idiomatic queries that return multiple entities in a single request.
- Automatic Index Selection - Use
.find()or.match()methods to dynamically and efficiently query based on defined sort key structures. - Simplified Pagination API - ElectroDB generates url safe cursors for pagination, allows for fine grain automated pagination, and supports async iteration.
- Strong TypeScript Inference - Strong TypeScript support for both Entities and Services now in Beta.
- Query Directly via the Terminal - Execute queries against your
Entities,Services,Modelsdirectly from the command line. - Stand Up Rest Server for Entities - Stand up a REST Server to interact with your
Entities,Services,Modelsfor easier prototyping. - Use with your existing tables - ElectroDB simplifies building DocumentClient parameters, so you can use it with existing tables/data.
Turn this
tasks
.patch({
team: "core",
task: "45-662",
project: "backend",
})
.set({ status: "open" })
.add({ points: 5 })
.append({
comments: [
{
user: "janet",
body: "This seems half-baked.",
},
],
})
.where(({ status }, { eq }) => eq(status, "in-progress"))
.go();
Into This
{
"UpdateExpression": "SET #status = :status_u0, #points = #points + :points_u0, #comments = list_append(#comments, :comments_u0), #updatedAt = :updatedAt_u0, #gsi1sk = :gsi1sk_u0",
"ExpressionAttributeNames": {
"#status": "status",
"#points": "points",
"#comments": "comments",
"#updatedAt": "updatedAt",
"#gsi1sk": "gsi1sk"
},
"ExpressionAttributeValues": {
":status0": "in-progress",
":status_u0": "open",
":points_u0": 5,
":comments_u0": [
{
"user": "janet",
"body": "This seems half-baked."
}
],
":updatedAt_u0": 1630977029015,
":gsi1sk_u0": "$assignments#tasks_1#status_open"
},
"TableName": "your_table_name",
"Key": {
"pk": "$taskapp#team_core",
"sk": "$tasks_1#project_backend#task_45-662"
},
"ConditionExpression": "attribute_exists(pk) AND attribute_exists(sk) AND #status = :status0"
}
Related Skills
tmux
336.9kRemote-control tmux sessions for interactive CLIs by sending keystrokes and scraping pane output.
claude-opus-4-5-migration
83.0kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
blogwatcher
336.9kMonitor blogs and RSS/Atom feeds for updates using the blogwatcher CLI.
LibreChat
35.0kEnhanced ChatGPT Clone: Features Agents, MCP, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active.
