{"id":19065860,"url":"https://github.com/msolvaag/redux-db","last_synced_at":"2025-08-02T01:09:13.158Z","repository":{"id":57350508,"uuid":"93723922","full_name":"msolvaag/redux-db","owner":"msolvaag","description":"A state management library for redux ","archived":false,"fork":false,"pushed_at":"2019-02-16T22:57:36.000Z","size":1501,"stargazers_count":25,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-28T14:16:35.836Z","etag":null,"topics":["database","normalize","orm","redux"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/msolvaag.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-08T08:12:03.000Z","updated_at":"2022-09-02T16:13:52.000Z","dependencies_parsed_at":"2022-08-30T20:00:55.609Z","dependency_job_id":null,"html_url":"https://github.com/msolvaag/redux-db","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/msolvaag/redux-db","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msolvaag%2Fredux-db","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msolvaag%2Fredux-db/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msolvaag%2Fredux-db/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msolvaag%2Fredux-db/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/msolvaag","download_url":"https://codeload.github.com/msolvaag/redux-db/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msolvaag%2Fredux-db/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268322378,"owners_count":24231817,"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","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["database","normalize","orm","redux"],"created_at":"2024-11-09T00:53:24.387Z","updated_at":"2025-08-02T01:09:13.104Z","avatar_url":"https://github.com/msolvaag.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![logo](logo.png \"redux-db\")\n\n[![NPM downloads](https://img.shields.io/npm/dm/redux-db.svg?style=flat-square)](https://www.npmjs.com/package/redux-db) [![NPM package](https://img.shields.io/npm/v/redux-db.svg?style=flat-square)](https://www.npmjs.com/package/redux-db)\n#\nredux-db provides a normalized [redux](http://redux.js.org) store and easy object management.\n\n## Why\n\nHaving a normalized state is a good strategy if your data is nested in different ways. The redux documentation has a nice explanation [here](http://redux.js.org/docs/recipes/reducers/NormalizingStateShape.html).\n\n## How\n\n```javascript\nimport db from \"./schema\";\n export const dbReducer = db.combineReducers(\n    (session, action) =\u003e {\n        const { BlogPost, Comment, User } = session;\n         switch (action.type) {\n            case \"POSTS_FETCH_DONE\":\n            case \"POST_FETCH_DONE\":\n            case \"POST_UPDATE\":\n            case \"POST_INSERT\":\n                // all these actions may be handled using just one statement.\n                // the upsert method accepts both single objects and arrays.\n                // the payload is automatically normalized and related tables are also updated.\n                 BlogPost.upsert(action.payload);\n                break;\n             case \"POST_DELETE\": {\n                const { id } = action.payload;\n                const post = BlogPost.get(id);\n                 post.comments.delete(); // Could be skipped if cascading deletes are defined.\n                post.delete();\n                 // or just, BlogPost.delete( id );\n                break;\n            }\n            case \"COMMENT_UPDATE\":\n            case \"COMMENT_INSERT\": {\n                // assuming payload contains {id,post,author}\n                const { post } = action.payload;\n                 BlogPost.get(post).comments.add(action.payload);\n                // or just, Comment.upsert(action.payload);\n                break;\n            }\n            case \"COMMENT_DELETE\": {\n                const { id } = action.payload;\n                Comment.delete(id);\n                break;\n            }\n        }\n    }\n);\n```\n\n## Documentation\n\nHead over to [http://redux-db.readthedocs.io](http://redux-db.readthedocs.io/en/latest/).\n\n## Examples\n\nYou will find an extensive example using redux-db to create a basic \"todo\" app in the /examples folder.\n\n## Contact / feedback\n\nFeel free to create issues and PR's.\n\n## Dependencies\n\n* none\n\n## Performance \u0026 size\n\nredux-db uses internal indexes to speed up lookups and is quite fast at the current state. However, optimizing performance and build size is a high priority forward. Current size is small, only ~5K minified and gzipped.\n\n## Credits\n\nThis project is inspired by libraries such as [normalizr](https://www.npmjs.com/package/normalizr) and [redux-orm](https://www.npmjs.com/package/redux-orm). redux-db is however a complete rewrite and only lends it's basic consepts.\n\n## Changelog\n\n### v0.9.0\n\n* Bugfixes and improvements\n\n### v0.8.0\n\n* Added support for providing a custom model factory.\n* BREAKING CHANGE: some exported interfaces are renamed\n  * Record =\u0026gt; TableRecord\n  * RecordSet =\u0026gt; TableRecordSet\n\n### v0.7.0\n\n* Added support for PK fields to also reference foreign tables. \n* Improved error handling for some cases.\n* BREAKING CHANGE: the field type \"FK\" is removed. Instead it is implied from the usage of the \"references\" definition.\n* Docs is updated to latest changes and features.\n\n### v0.6.0\n\n* Added support for one 2 one relationships\n* Added support for cascading deletes\n* Improved typings\n* Minor optimizations\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsolvaag%2Fredux-db","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsolvaag%2Fredux-db","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsolvaag%2Fredux-db/lists"}