Plugin Request: Generate Ecto "schema.ex" and "migration.exs" files for Elixir/Ecto Language Platform #21

Open
opened 2022-01-22 00:37:14 +00:00 by mrjbj · 0 comments
mrjbj commented 2022-01-22 00:37:14 +00:00 (Migrated from github.com)

I love pgModeler but am struggling to integrate it into the workflow by Elixir developers. Elixir uses a database persistence framework called "Ecto", which is actually freaking amazing. However, it requires two files be maintained in a "code-first" approach to the database. The first file (called a "schema") governs how application data is cast to/from data types in the UI to database (and that data passes business validations). The second file (called a "migration") is used to create/alter/seed the database itself.

My current workflow is to design in pgModeler, then manually create these two files based pretty much 1:1 from column content already designed into pgModeler. It would be super helpful if the "create code" feature of pgModeler could be templated in such a way as to emit these Elixir/Ecto schema and migration files as an option. Given that the pgModeler files are saved in XML format, I suppose I could probably figure out a way transform from this using Elixir myself, but I was thinking perhaps this plugin architecture might be an easier or more supportable way of doing so instead.

Here is a link to overview on Ecto, if interested. No worries if not a good idea or not enough people use Elixir yet. Just wanted to get the idea out there for consideration. Thank you.

Elixir/Ecto Basic Overview

I love pgModeler but am struggling to integrate it into the workflow by Elixir developers. Elixir uses a database persistence framework called "Ecto", which is actually freaking amazing. However, it requires two files be maintained in a "code-first" approach to the database. The first file (called a "schema") governs how application data is cast to/from data types in the UI to database (and that data passes business validations). The second file (called a "migration") is used to create/alter/seed the database itself. My current workflow is to design in pgModeler, then manually create these two files based pretty much 1:1 from column content already designed into pgModeler. It would be super helpful if the "create code" feature of pgModeler could be templated in such a way as to emit these Elixir/Ecto schema and migration files as an option. Given that the pgModeler files are saved in XML format, I suppose I could probably figure out a way transform from this using Elixir myself, but I was thinking perhaps this plugin architecture might be an easier or more supportable way of doing so instead. Here is a link to overview on Ecto, if interested. No worries if not a good idea or not enough people use Elixir yet. Just wanted to get the idea out there for consideration. Thank you. [Elixir/Ecto Basic Overview](https://elixirschool.com/en/lessons/ecto/basics)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pgmodeler/plugins#21
No description provided.