{"id":18789791,"url":"https://github.com/woylie/ecto_nested_changeset","last_synced_at":"2025-05-05T22:33:19.603Z","repository":{"id":38366523,"uuid":"400409772","full_name":"woylie/ecto_nested_changeset","owner":"woylie","description":"Helpers for manipulating nested Ecto changesets","archived":false,"fork":false,"pushed_at":"2025-04-18T23:33:47.000Z","size":495,"stargazers_count":54,"open_issues_count":2,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-19T09:51:29.354Z","etag":null,"topics":["changeset","dynamic-forms","ecto","elixir","liveview","phoenix"],"latest_commit_sha":null,"homepage":"","language":"Elixir","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/woylie.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"woylie"}},"created_at":"2021-08-27T06:22:37.000Z","updated_at":"2025-04-18T23:33:51.000Z","dependencies_parsed_at":"2024-01-20T04:22:25.646Z","dependency_job_id":"b2aafa45-6d82-4d6e-a0c9-e8463a5f6fd4","html_url":"https://github.com/woylie/ecto_nested_changeset","commit_stats":{"total_commits":189,"total_committers":4,"mean_commits":47.25,"dds":0.4973544973544973,"last_synced_commit":"1c5e44da426941a49916eebde39dcd4ce82a3d57"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woylie%2Fecto_nested_changeset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woylie%2Fecto_nested_changeset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woylie%2Fecto_nested_changeset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woylie%2Fecto_nested_changeset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/woylie","download_url":"https://codeload.github.com/woylie/ecto_nested_changeset/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252586373,"owners_count":21772286,"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":["changeset","dynamic-forms","ecto","elixir","liveview","phoenix"],"created_at":"2024-11-07T21:08:40.826Z","updated_at":"2025-05-05T22:33:19.586Z","avatar_url":"https://github.com/woylie.png","language":"Elixir","readme":"[![CI](https://github.com/woylie/ecto_nested_changeset/actions/workflows/ci.yml/badge.svg)](https://github.com/woylie/ecto_nested_changeset/actions/workflows/ci.yml) [![Hex](https://img.shields.io/hexpm/v/ecto_nested_changeset)](https://hex.pm/packages/ecto_nested_changeset) [![Coverage Status](https://coveralls.io/repos/github/woylie/ecto_nested_changeset/badge.svg?branch=main)](https://coveralls.io/github/woylie/ecto_nested_changeset?branch=main)\n\n# EctoNestedChangeset\n\nThis is a package for manipulating nested\n[Ecto](https://github.com/elixir-ecto/ecto) changesets.\n\n## Installation\n\nAdd `ecto_nested_changeset` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:ecto_nested_changeset, \"~\u003e 1.0.0\"}\n  ]\nend\n```\n\n## Usage\n\nThe primary use case of this library is the manipulation of\n[Ecto](https://github.com/elixir-ecto/ecto) changesets\nused as a source for dynamic, nested forms in\n[Phoenix LiveView](https://github.com/phoenixframework/phoenix_live_view).\n\n```elixir\ncategory = %Category{\n  posts: [\n    %Post{\n      id: 1,\n      comments: [\n        %Comment{body: \"potato\", id: 1},\n        %Comment{body: \"you\", id: 2}\n      ],\n      title: \"must\"\n    },\n    %Post{comments: [], id: 2, title: \"young\"}\n  ]\n}\n\ncategory\n|\u003e Ecto.Changeset.change()\n|\u003e append_at(:posts, %Post{title: \"Padawan\", comments: []})\n|\u003e prepend_at([:posts, 0, :comments], %Comment{body: \"ecneitaP\"})\n|\u003e delete_at([:posts, 0, :comments, 1], mode: {:action, :delete})\n|\u003e insert_at([:posts, 1], %Post{title: \"have\"})\n|\u003e append_at([:posts, 2, :comments], %Comment{body: \"my\"})\n|\u003e update_at([:posts, 0, :comments, 0, :body], \u0026String.reverse/1)\n|\u003e Ecto.Changeset.apply_changes()\n\n%Category{\n  posts: [\n    %Post{\n      comments: [\n        %Comment{body: \"Patience\"},\n        %Comment{body: \"you\", id: 2}\n      ],\n      id: 1,\n      title: \"must\"\n    },\n    %Post{title: \"have\"},\n    %Post{\n      comments: [%Comment{body: \"my\"}],\n      id: 2,\n      title: \"young\"\n    },\n    %Post{title: \"Padawan\"}\n  ]\n}\n```\n\n## Example application\n\nThere is an example Phoenix application with a dynamic nested LiveView form in\nthe `/example` folder of the repository.\n\n```bash\ngit clone https://github.com/woylie/ecto_nested_changeset.git\ncd ecto_nested_changeset/example\nmix setup\nmix phx.server\n```\n\nNote that Postgres needs to be running to use the application.\n\nYou can access the application at http://localhost:4000.\n\n## Status\n\nThis library is actively maintained, but given its narrow purpose, it will not\nsee frequent updates.\n","funding_links":["https://github.com/sponsors/woylie"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwoylie%2Fecto_nested_changeset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwoylie%2Fecto_nested_changeset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwoylie%2Fecto_nested_changeset/lists"}