{"id":13507154,"url":"https://github.com/tywalch/electrodb","last_synced_at":"2025-05-13T19:16:44.695Z","repository":{"id":37007489,"uuid":"246464154","full_name":"tywalch/electrodb","owner":"tywalch","description":"A DynamoDB library to ease the use of modeling complex hierarchical relationships and implementing a Single Table Design while keeping your query code readable.","archived":false,"fork":false,"pushed_at":"2025-03-23T15:18:32.000Z","size":9287,"stargazers_count":1060,"open_issues_count":96,"forks_count":74,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-28T10:57:51.640Z","etag":null,"topics":["aws","dynamodb","dynamodb-client","dynamodb-database","nosql","nosql-data-storage","nosql-database","single-table-design"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tywalch.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-03-11T03:20:03.000Z","updated_at":"2025-04-25T09:01:18.000Z","dependencies_parsed_at":"2023-11-12T23:22:10.648Z","dependency_job_id":"6439518c-3a53-4b02-9c33-0d64d353eafe","html_url":"https://github.com/tywalch/electrodb","commit_stats":{"total_commits":404,"total_committers":8,"mean_commits":50.5,"dds":"0.022277227722772297","last_synced_commit":"5d515be23e91d7e7405748900b5670c14d959c4e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tywalch%2Felectrodb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tywalch%2Felectrodb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tywalch%2Felectrodb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tywalch%2Felectrodb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tywalch","download_url":"https://codeload.github.com/tywalch/electrodb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254010822,"owners_count":21999003,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","dynamodb","dynamodb-client","dynamodb-database","nosql","nosql-data-storage","nosql-database","single-table-design"],"created_at":"2024-08-01T02:00:25.409Z","updated_at":"2025-05-13T19:16:44.637Z","avatar_url":"https://github.com/tywalch.png","language":"JavaScript","funding_links":[],"categories":["Projects using `@faker-js/faker`","JavaScript","TypeScript","Tools"],"sub_categories":[],"readme":"# ElectroDB\n\n[![Download Count](https://img.shields.io/npm/dt/electrodb.svg)](https://www.npmjs.com/package/electrodb)\n[![Coverage Status](https://coveralls.io/repos/github/tywalch/electrodb/badge.svg?branch=master)](https://coveralls.io/github/tywalch/electrodb?branch=master\u0026kill_cache=please)\n![NPM Bundle Size](https://img.shields.io/bundlephobia/min/electrodb)\n[![Runkit Demo](https://img.shields.io/badge/runkit-electrodb-db4792)](https://runkit.com/tywalch/electrodb-building-queries)\n[![Last Commit](https://img.shields.io/github/last-commit/tywalch/electrodb)](https://github.com/tywalch/electrodb/commits/master)\n[![Issues](https://img.shields.io/github/issues/tywalch/electrodb)](https://github.com/tywalch/electrodb/issues)\n[![Sponsors](https://img.shields.io/github/sponsors/tywalch)](https://github.com/tywalch)\n[![Github Stars](https://img.shields.io/github/stars/tywalch/electrodb?style=social)](https://github.com/tywalch/electrodb/stargazers)\n\n![Logo](./assets/electrodb-drk-compressed.png#gh-dark-mode-only)\n![Logo](./assets/electrodb.png#gh-light-mode-only)\n\n**_ElectroDB_** is a DynamoDB library to ease the use of having multiple entities and complex hierarchical relationships in a single DynamoDB table.\n\n_Please submit issues/feedback or reach out on Twitter [@tinkertamper](https://twitter.com/tinkertamper)._\n\n\u003ca href=\"https://electrodb.dev/en/core-concepts/v3-migration/\"\u003e\u003ch1 align=\"center\"\u003eElectroDB v3 now released\u003c/h1\u003e\u003c/a\u003e\n\n\u003cp align=\"center\"\u003eVisit the \u003ca href=\"https://electrodb.dev/en/core-concepts/v3-migration/\"\u003ev3 migration page\u003c/a\u003e to learn more about this new update.\u003c/p\u003e\n\n---\n\n\u003ca href=\"https://electrodb.dev\"\u003e\u003ch1 align=\"center\"\u003eDocumentation now found at ElectroDB.dev\u003c/h1\u003e\u003c/a\u003e\n\n\u003cp align=\"center\"\u003eElectroDB's new website for Documentation is now live at \u003ca href=\"https://electrodb.dev\"\u003eelectrodb.dev\u003c/a\u003e.\u003c/p\u003e\n\n---\n\n\u003ca href=\"https://electrodb.fun\"\u003e\u003ch1 align=\"center\"\u003eThe NEW ElectroDB Playground\u003c/h1\u003e\u003c/a\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://electrodb.fun\"\u003e\u003cimg width=\"400\" src=\"https://github.com/tywalch/electrodb/blob/master/assets/playground.jpg?raw=true\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003eTry out and share ElectroDB Models, Services, and Single Table Design at \u003ca href=\"https://electrodb.fun\"\u003eelectrodb.fun\u003c/a\u003e\u003c/p\u003e\n\n---\n\n## Features\n\n- [**Single-Table Entity Isolation**](https://electrodb.dev/en/modeling/entities/) - Entities created with **ElectroDB** will not conflict with other entities when using a single DynamoDB table.\n- [**Attribute Schema Enforcement**](https://electrodb.dev/en/modeling/attributes/) - Define a schema for your entities with enforced attribute validation, defaults, types, aliases, and more.\n- [**Easily Compose Hierarchical Access Patterns**](https://electrodb.dev/en/modeling/indexes/) - Plan and design hierarchical keys for your indexes to multiply your possible access patterns.\n- [**Simplified Sort Key Condition Querying**](https://electrodb.dev/en/queries/query/) - Write efficient sort key queries by easily building compose keys.\n- [**Simplified Filter Composition**](https://electrodb.dev/en/queries/filters/) - Easily create complex readable filters for DynamoDB queries without worrying about the implementation of `ExpressionAttributeNames`, `ExpressionAttributeValues`, and `FilterExpressions`.\n- [**Simplified Condition Composition**](https://electrodb.dev/en/mutations/conditions/) - Use the same interface to casily create complex readable mutation conditions for DynamoDB queries without worrying about the implementation of `ExpressionAttributeNames`, `ExpressionAttributeValues`, and `ConditionExpressions`.\n- [**Simplified Update Expression Composition**](https://electrodb.dev/en/mutations/update/) - Easily compose type safe update operations without having to format tedious `ExpressionAttributeNames`, `ExpressionAttributeValues`, and `UpdateExpressions`.\n- [**Easily Query Across Entities**](https://electrodb.dev/en/core-concepts/single-table-relationships) - Define \"collections\" to create powerful/idiomatic queries that return multiple entities in a single request.\n- [**Automatic Index Selection**](https://electrodb.dev/en/queries/find/) - Use `.find()` or `.match()` methods to dynamically and efficiently query based on defined sort key structures.\n- [**Simplified Pagination API**](https://electrodb.dev/en/queries/pagination/) - ElectroDB generates url safe cursors for pagination, allows for fine grain automated pagination, and supports async iteration.\n- [**Strong TypeScript Inference**](https://electrodb.dev/en/reference/typescript/) - Strong **TypeScript** support for both Entities and Services now in Beta.\n- [**Query Directly via the Terminal**](https://github.com/tywalch/electrocli#query-taskapp) - Execute queries against your `Entities`, `Services`, `Models` directly from the command line.\n- [**Stand Up Rest Server for Entities**](https://github.com/tywalch/electrocli#query-taskapp) - Stand up a REST Server to interact with your `Entities`, `Services`, `Models` for easier prototyping.\n- [**Use with your existing tables**](https://electrodb.dev/en/recipes/use-electrodb-with-existing-table/) - ElectroDB simplifies building DocumentClient parameters, so you can use it with existing tables/data.\n\n---\n\n**Turn this**\n\n```typescript\ntasks\n  .patch({\n    team: \"core\",\n    task: \"45-662\",\n    project: \"backend\",\n  })\n  .set({ status: \"open\" })\n  .add({ points: 5 })\n  .append({\n    comments: [\n      {\n        user: \"janet\",\n        body: \"This seems half-baked.\",\n      },\n    ],\n  })\n  .where(({ status }, { eq }) =\u003e eq(status, \"in-progress\"))\n  .go();\n```\n\n**Into This**\n\n```json\n{\n  \"UpdateExpression\": \"SET #status = :status_u0, #points = #points + :points_u0, #comments = list_append(#comments, :comments_u0), #updatedAt = :updatedAt_u0, #gsi1sk = :gsi1sk_u0\",\n  \"ExpressionAttributeNames\": {\n    \"#status\": \"status\",\n    \"#points\": \"points\",\n    \"#comments\": \"comments\",\n    \"#updatedAt\": \"updatedAt\",\n    \"#gsi1sk\": \"gsi1sk\"\n  },\n  \"ExpressionAttributeValues\": {\n    \":status0\": \"in-progress\",\n    \":status_u0\": \"open\",\n    \":points_u0\": 5,\n    \":comments_u0\": [\n      {\n        \"user\": \"janet\",\n        \"body\": \"This seems half-baked.\"\n      }\n    ],\n    \":updatedAt_u0\": 1630977029015,\n    \":gsi1sk_u0\": \"$assignments#tasks_1#status_open\"\n  },\n  \"TableName\": \"your_table_name\",\n  \"Key\": {\n    \"pk\": \"$taskapp#team_core\",\n    \"sk\": \"$tasks_1#project_backend#task_45-662\"\n  },\n  \"ConditionExpression\": \"attribute_exists(pk) AND attribute_exists(sk) AND #status = :status0\"\n}\n```\n\n[![Try it out!](https://img.shields.io/badge/electrodb-try_out_this_example_›-%23f9bd00?style=for-the-badge\u0026logo=amazondynamodb\u0026labelColor=1a212a)](https://electrodb.fun/?#code/PQKgBAsg9gJgpgGzARwK5wE4Es4GcA0YuccYGeqCALgUQBYCG5YA7llXWAGbZwB2MXGBDAAUKKwBbAA5QMVMAG8wAUT5V2AT0IBlTADcsAY1IBfbhiiSwAIkRwjVSzABGNgNzijUPrgVUGFwRSAF5bTShUDAB9AKC4aL4GSTgPcVAwABUGXABrITUNKk1hMW9ffxz8sDC+OBZVdS0AClEwJTb2sElYRAAuDq6u-iLNAZsAvNwbf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Vw3HcDyJFAVDRI9+53aIBy4J0dGm4pzTKJsYXjN45ATkitgACwAKzBgAbDnABMgabJ1jjjC4635QIC6mKRUfEFQcdEAEyuzr6-o2NBtftHR7EwI39brgMmed1HRz+n38dDCut2zl6Y1dFT4wUnzY5Xv+MCATYmR0FbxDTkIjAIFwwbl-lMB0V+0E5p0NdRywdCYHAzTNEoStCucSh4uYmlUXizRv7QGwIYwwRjwNMUiXcwB0UBFAMi7ggA)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftywalch%2Felectrodb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftywalch%2Felectrodb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftywalch%2Felectrodb/lists"}