Generate Ecto schemas
generate_ecto_schemasReads a PostgreSQL schema and generates Ecto schema modules, one per table, with field declarations, belongs_to for foreign keys, and timestamps.
Instructions
Read a PostgreSQL schema and emit Ecto (Elixir) schema modules — one .ex file per table, named after the singularised table. Each module uses Ecto.Schema with field declarations, belongs_to for single-column intra-schema FKs, and timestamps() when both inserted_at and updated_at exist. The Elixir top-level module is configurable via app_module (default MyApp). Returns a JSON object {filename: source} so the agent can write each file.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| schema | Yes | ||
| database | No | Optional: target a configured secondary (read-only) database by name; omit for the primary. Call list_databases to see the configured ids. | |
| app_module | No | MyApp |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||