fuelen
Hi all!
I want to present a small library which provides a mix task for generating an Entity-Relationship Diagram for Ecto schemas.
You can check examples of output for a couple of open-source projects in docs or directly on GitHub.
Links:
Trending in Announcing
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries.
offset-based pagination with...
New
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi all!
I want to present a small library which provides a mix task for generating an Entity-Relationship Diagram for Ecto schemas.
You...
New
Hello
Published a new library - ProcessHub!
ProcessHub is a library designed to manage process distribution within the Elixir cluster. ...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
This showed up on my feed.. anyone heard of it? Just hype?
Ox Alpha is a reasoning model designed for coding, sustained ag...
New
It’s not that it’s vocabulary is too advanced. It’s something worse.
I get lost trying to follow even a paragraph written by Claude. It’...
New
Today we’re releasing Oban for Python. Not an Oban client in Python. Not a pythonx wrapper embedded in Elixir. Nope, it’s a fully operati...
New
@hugobarauna, Dr. Dimitrios Koutmos (my brother) and I (Alex Koutmos) have been hard at work on writing a book on how you can use Elixir ...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 13 to 4- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
fuelen
Ecto ERD v0.8.0 is out!
Highlights:
Eiji
I think working with that table is bad practice. First of all
ectorely on it, so developer should not:I don’t also see how other libraries are gonna using it and what’s more important is that
schema_mirationsis not documented anywhere inectoandecto_sqlhex documentation (there is onlyschema_mirationoption inRepocallback). I would say that usingschema_mirationstable in any way is like using a private API.Yeah, I completely forgot about that
In that case it should be in new line under
Module.Name.In my personal opinion the diagram is the most clear. It’s not like that from very start I liked the arrows (maybe legend for them?) or colors, but I was used to it very quickly.
Yes, I also reminded that there could be for example
.Schemasuffix, so it’s better to make it easily configurable.Ok, after modifications this is what I have in mind:
my_schema.my_table
string_field (legacy_string_field_source) : string
integer_field : int
If we could make
DOTlayout looks likePlantUMLimage then yes - with field connection it would be even more amazing and we do not need to noteforeign_key_idthen.Generally I would like to use such graphs to show other people context about planned
API(context + module) anddatabasestructure (source fields). This is why for exampleMyAppis completely not needed and so on …fuelen
Thank you for detailed feedback!
Sounds reasonable, but if there is an app that works with this table somehow, then we’d have to add more options to show the schema again. As for now, it can be easily removed using config file:
Primary keys are not required. Seems like you just want to see a table name. I think there are better ways of doing this, like add one more row which shows schema prefix and table name.
It is a bit noisy. The downside of
PlantUMLis that it doesn’t support precise connections between fields (using arrows), as it is done in our dot renderer.What do you like in
PlantUMLthe most? AFAIK, it usesGraphvizunder the hood, and maybe we can modify/add an option to our dot renderer to have similar experience.That’s a good idea to have an ability to format module name, but definitely not by default, as such names can overlap.
Eiji
Looks awesome. Going to test it soon. Thanks!
Edit: Just tried all formats and my favourite one is
PlantUMLas it’s generating best graph images.I would like to suggest small changes:
ectointernallyidto something like:id : id (schema_name.table_name)(as passed toschemamacro)?idfields to something likefield_name : id (schema_name.table_name.foreign_key_field_name)Elixirmodule, so we have just shortMyContext.MySchemainstead ofMyApp.MyContext.MySchema?So for example instead of:
string_field : string
we would have:
string_field : string
Nezteb
Just used this for a take-home coding assessment where I’m asked to dissect an existing Ecto schema and fix some related tests.
This lib and the ERD it generated were extremely helpful. Thank you for building this!
fuelen
Added Mermaid support in version 0.5.0
fuelen
Added PlantUML support in version 0.4.0
webuhu
Very cool. Thanks a lot.
It could probably replace ERAlchemy the tool I’m still using for this kind of documentation task.
jc00ke
@fuelen thank you so much! I just used
Ecto.ERDand it worked nicely.fuelen
Added QuickDBD support in version 0.3.0