Syed Rohaan Alam <rohaana...@gmail.com>: Apr 20 09:57AM -0700
I built a prototype Mix library called `ecto_database_first` that
introspects an
existing PostgreSQL database and generates:
- Ecto schemas
- context modules
- optional migration snapshots
- a scaffold report with warnings and guidance
It also normalizes quoted/mixed-case PostgreSQL identifiers into valid
Elixir
and Ecto code and supports configuration-driven execution from the consuming
application.
*Motivation*
There is a common need for teams adopting Ecto on existing databases to get
a
clean, idiomatic starting point instead of hand-writing every schema and
association from scratch.
The goal is not just reverse engineering, but generation of maintainable
code
that keeps querying inside contexts and surfaces schema issues in a report.
*Question*
Would the Ecto maintainers consider this kind of feature:
1. appropriate for `ecto`
2. more appropriate for `ecto_sql`
3. or better kept as a standalone Hex package in the Ecto ecosystem
*Current scope of the prototype*
- PostgreSQL introspection
- Ecto schema generation
- context generation
- association generation
- optional snapshot migrations
- scaffold report with schema guidance
- support for app config plus CLI overrides
*Note:*
I understand Ecto core is intentionally stable and selective about new
surface area, so I would appreciate guidance on whether this should be
proposed
as a smaller integration point instead of a full upstream feature.
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to elixir-ecto...@googlegroups.com.
Thank you very much for taking the time to review my work and for your thoughtful feedback — I genuinely appreciate it.
Your suggestion about prioritizing MS SQL Server and Oracle is very helpful. I actually am already working with Oracle as well, and MS SQL Server support was previously included in the prototype too, though I haven’t yet updated the repository to reflect that properly. I’ll make sure to align the documentation and scope accordingly as I continue refining it.
I also wanted to say that your feedback was especially valuable to me. It gave me a much clearer direction on where to focus and how to position the project going forward.
Thank you again for your time, insight, and honest suggestions — I really appreciate it.