{"id":13707003,"url":"https://github.com/fuelen/ecto_erd","last_synced_at":"2025-04-12T21:33:46.954Z","repository":{"id":38377454,"uuid":"398801365","full_name":"fuelen/ecto_erd","owner":"fuelen","description":"A mix task for generating Entity Relationship Diagram from Ecto schemas available in your project.","archived":false,"fork":false,"pushed_at":"2025-03-11T18:47:23.000Z","size":85102,"stargazers_count":227,"open_issues_count":5,"forks_count":15,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-04T01:09:10.015Z","etag":null,"topics":["dbml","ecto","elixir","erd","graphviz","mermaid","plantuml","uml"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fuelen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2021-08-22T13:03:34.000Z","updated_at":"2025-04-01T17:34:26.000Z","dependencies_parsed_at":"2024-04-13T02:44:18.882Z","dependency_job_id":"ff0364b4-95ff-4563-819c-8f21a4d7107d","html_url":"https://github.com/fuelen/ecto_erd","commit_stats":{"total_commits":56,"total_committers":7,"mean_commits":8.0,"dds":0.5357142857142857,"last_synced_commit":"851acdfd55f4294a71e233721ae755aa9c3eb5c9"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuelen%2Fecto_erd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuelen%2Fecto_erd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuelen%2Fecto_erd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuelen%2Fecto_erd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fuelen","download_url":"https://codeload.github.com/fuelen/ecto_erd/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248635734,"owners_count":21137292,"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":["dbml","ecto","elixir","erd","graphviz","mermaid","plantuml","uml"],"created_at":"2024-08-02T22:01:14.688Z","updated_at":"2025-04-12T21:33:46.931Z","avatar_url":"https://github.com/fuelen.png","language":"Elixir","funding_links":[],"categories":["Elixir"],"sub_categories":[],"readme":"# Ecto.ERD\n\n[![Hex.pm](https://img.shields.io/hexpm/v/ecto_erd.svg)](https://hex.pm/packages/ecto_erd)\n\nA mix task for generating an ERD (Entity Relationship Diagram) in various\nformats for all Ecto schemas available in your project.\n\nSupported formats:\n\n* [DOT](https://en.wikipedia.org/wiki/DOT_(graph_description_language)) (default)\n* [PlantUML](https://plantuml.com)\n* [DBML](https://www.dbml.org/)\n* [QuickDBD](https://www.quickdatabasediagrams.com)\n* [Mermaid](https://mermaid-js.github.io/mermaid/#/entityRelationshipDiagram)\n\n![Simple blog demo](assets/simple_blog_dot_demo.png)\n\u003cdetails\u003e\n  \u003csummary\u003eDefinition of schemas\u003c/summary\u003e\n\n  ```elixir\n  defmodule Blog.Post do\n    use Ecto.Schema\n\n    schema \"posts\" do\n      field(:title, :string)\n      field(:text, :string)\n      timestamps()\n      belongs_to(:user, Blog.User)\n      has_many(:comments, Blog.Comment)\n    end\n  end\n\n  defmodule Blog.Comment do\n    use Ecto.Schema\n\n    schema \"comments\" do\n      field(:text, :string)\n      timestamps()\n      belongs_to(:post, Blog.Post)\n      belongs_to(:user, Blog.User)\n    end\n  end\n\n  defmodule Blog.User do\n    use Ecto.Schema\n\n    schema \"users\" do\n      field(:email, :string)\n      has_many(:posts, Blog.Post)\n      has_many(:comments, Blog.Comment)\n    end\n  end\n  ```\n\n\u003c/details\u003e\n\n## Installation\n\nThe package can be installed by adding `ecto_erd` to your list of dependencies\nin `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:ecto_erd, \"~\u003e 0.6\", only: :dev}\n  ]\nend\n```\n\n## Usage\n\nJust run:\n\n```sh\nmix ecto.gen.erd\n```\n\nThe command above produces a file in DOT format which can be converted to an\nimage using `graphviz` utility:\n\n```sh\ndot -Tpng ecto_erd.dot -o erd.png\n```\n\nConfiguration is possible via `.ecto_erd.exs` file.\nThe docs can be found at [https://hexdocs.pm/ecto_erd](https://hexdocs.pm/ecto_erd).\nConfiguration examples and output for a couple of open-source projects can be\nfound in EXAMPLES group of PAGES section.\n\n## Troubleshooting\n\nTrying to run `ecto_erd` on an umbrella project? Did you get this error?\n\n```\n$ mix ecto.gen.erd\n** (RuntimeError) Unable to detect `:otp_app`, please specify it explicitly\n```\n\nThe easiest solution is to run the command on one of the apps in the `apps/` directory. Another option is to create a configuration file and specify the `:otp_app`. See the [docs for details](https://hexdocs.pm/ecto_erd/Mix.Tasks.Ecto.Gen.Erd.html#module-configuration-file).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuelen%2Fecto_erd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffuelen%2Fecto_erd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuelen%2Fecto_erd/lists"}