ElectroDB

Build complex DynamoDB queries with confidence. Type-safe single-table design, entity modeling, and powerful relationships — without writing a single raw parameter object.

Write this
const { data } = await 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();
Skip 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"
}

The snippet above updates a task — partially, conditionally, and with a new comment appended. ElectroDB resolves the composite keys, builds the update expression, and applies the condition. You write intent; it writes parameters. Try this exact example in the Playground →

Why ElectroDB?

DynamoDB is fast, scalable, and cheap — but raw DocumentClient calls force you to hand-write parameter objects, juggle composite keys, and re-prove the same access patterns on every change. ElectroDB turns that boilerplate into a single, type-safe model — so you focus on the application, not the parameter language.

End-to-end type safety

Your schema becomes your types. Autocomplete on attributes, indexes, and return values — typos and shape errors fail at compile time, not 3am.

Single-table design, simplified

Define entities once and ElectroDB handles partition keys, sort keys, GSIs, and entity isolation. Multiple entities, one table, no spaghetti.

Queries that compose

Chain get, put, update, patch, query, and scan with first-class filter and condition expressions. Batch and transactional operations work the same way.

Drop-in for any AWS setup

Works with the AWS SDK v2 or v3, in Node, Lambda, or edge runtimes. ElectroDB outputs plain DynamoDB params — easy to log, inspect, and combine with whatever you already have.

Ready to ship?

The fastest way to learn ElectroDB is to model something. Open the Playground to experiment with a schema in the browser, or jump straight to the Quick Start for a real install + first entity.