{"id":15288013,"url":"https://github.com/alexandrubagu/ecto_generator","last_synced_at":"2025-10-21T15:06:20.452Z","repository":{"id":57493133,"uuid":"69660518","full_name":"alexandrubagu/ecto_generator","owner":"alexandrubagu","description":"Generate Ecto schemas from existing database in Phoenix - Elixir","archived":true,"fork":false,"pushed_at":"2018-09-23T20:19:27.000Z","size":21,"stargazers_count":22,"open_issues_count":0,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-01T12:46:23.786Z","etag":null,"topics":["ecto","ecto-schemas","elixir","existing-database","generate","phoenix","schema"],"latest_commit_sha":null,"homepage":"https://hex.pm/packages/ecto_generator","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexandrubagu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-30T11:16:05.000Z","updated_at":"2024-03-04T16:13:42.000Z","dependencies_parsed_at":"2022-08-28T11:51:54.093Z","dependency_job_id":null,"html_url":"https://github.com/alexandrubagu/ecto_generator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexandrubagu%2Fecto_generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexandrubagu%2Fecto_generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexandrubagu%2Fecto_generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexandrubagu%2Fecto_generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexandrubagu","download_url":"https://codeload.github.com/alexandrubagu/ecto_generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235581533,"owners_count":19013089,"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":["ecto","ecto-schemas","elixir","existing-database","generate","phoenix","schema"],"created_at":"2024-09-30T15:43:46.935Z","updated_at":"2025-10-07T02:31:59.668Z","avatar_url":"https://github.com/alexandrubagu.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EctoGenerator\nGenerate Ecto schemas/models from existing database in Phoenix - Elixir\n\n## Installation \n#### Generate new Phoenix application\n```elixir\n[alexandrubagu@localhost devel]$ mix phoenix.new postgresapp\n```\nor\n\n```elixir\n[alexandrubagu@localhost devel]$ mix phoenix.new mysqlapp --database mysql\n```\n\n#### Add `ecto_generator` to your list of dependencies in `mix.exs`:\n```elixir\ndef deps do\n  [{:ecto_generator, \"~\u003e 9.0.0\"}]\nend\n```\n\n#### Install mix dependencies by running the following command in bash `mix deps.get`\n#### Edit you configuration if is necessary:\n```elixir\n# Configure your database\nconfig :mysqlapp, Mysqlapp.Repo,\n  adapter: Ecto.Adapters.MySQL,\n  username: \"root\",\n  password: \"\",\n  database: \"hello_phoenix_dev\",\n  hostname: \"localhost\",\n  pool_size: 10\n```\n\n#### Now you will find `ecto.dump.schema` in mix tasks:\n```elixir\n[alexandrubagu@localhost devel/phoenix/] mix ecto\nEcto v2.0.5\nA database wrapper and language integrated query for Elixir.\n\nAvailable tasks:\n\nmix ecto.create        # Creates the repository storage\nmix ecto.drop          # Drops the repository storage\nmix ecto.dump          # Dumps the repository database structure\nmix ecto.dump.schema   # Dump models/schemas from repos\nmix ecto.gen.migration # Generates a new migration for the repo\nmix ecto.gen.repo      # Generates a new repository\nmix ecto.load          # Loads previously dumped database structure\nmix ecto.migrate       # Runs the repository migrations\nmix ecto.migrations    # Displays the repository migration status\nmix ecto.rollback      # Rolls back the repository migrations\n```\n\n\n#### Output Sample\n```elixir\n[alexandrubagu@localhost devel/mysqlapp ] mix ecto.dump.schema\n13:15:04.270 [debug] QUERY OK db=0.8ms decode=0.1ms queue=15.2ms\nSELECT table_name FROM information_schema.tables WHERE table_schema = 'sakila' []\n\n13:15:04.272 [debug] QUERY OK db=0.9ms\nSELECT COLUMN_NAME, DATA_TYPE, CASE WHEN `COLUMN_KEY` = 'PRI' THEN '1' ELSE NULL END AS primary_key FROM information_schema.columns WHERE table_name= 'actor' and table_schema='sakila' []\n  web/models/actor.ex was generated\n\n13:15:04.289 [debug] QUERY OK db=1.6ms decode=0.1ms\nSELECT COLUMN_NAME, DATA_TYPE, CASE WHEN `COLUMN_KEY` = 'PRI' THEN '1' ELSE NULL END AS primary_key FROM information_schema.columns WHERE table_name= 'actor_info' and table_schema='sakila' []\n  web/models/actor_info.ex was generated\n\n13:15:04.293 [debug] QUERY OK db=1.2ms decode=0.1ms\nSELECT COLUMN_NAME, DATA_TYPE, CASE WHEN `COLUMN_KEY` = 'PRI' THEN '1' ELSE NULL END AS primary_key FROM information_schema.columns WHERE table_name= 'address' and table_schema='sakila' []\n  web/models/address.ex was generated\n\n13:15:04.298 [debug] QUERY OK db=0.8ms\nSELECT COLUMN_NAME, DATA_TYPE, CASE WHEN `COLUMN_KEY` = 'PRI' THEN '1' ELSE NULL END AS primary_key FROM information_schema.columns WHERE table_name= 'category' and table_schema='sakila' []\n  web/models/category.ex was generated\n\n13:15:04.302 [debug] QUERY OK db=0.8ms\nSELECT COLUMN_NAME, DATA_TYPE, CASE WHEN `COLUMN_KEY` = 'PRI' THEN '1' ELSE NULL END AS primary_key FROM information_schema.columns WHERE table_name= 'city' and table_schema='sakila' []\n  web/models/city.ex was generated\n\n13:15:04.306 [debug] QUERY OK db=0.7ms\nSELECT COLUMN_NAME, DATA_TYPE, CASE WHEN `COLUMN_KEY` = 'PRI' THEN '1' ELSE NULL END AS primary_key FROM information_schema.columns WHERE table_name= 'country' and table_schema='sakila' []\n  web/models/country.ex was generated\n\n13:15:04.310 [debug] QUERY OK db=1.0ms\nSELECT COLUMN_NAME, DATA_TYPE, CASE WHEN `COLUMN_KEY` = 'PRI' THEN '1' ELSE NULL END AS primary_key FROM information_schema.columns WHERE table_name= 'customer' and table_schema='sakila' []\n  web/models/customer.ex was generated\n  enum is not supported ... Fallback to :string\n  set is not supported ... Fallback to :string\n\n13:15:04.314 [debug] QUERY OK db=0.9ms\nSELECT COLUMN_NAME, DATA_TYPE, CASE WHEN `COLUMN_KEY` = 'PRI' THEN '1' ELSE NULL END AS primary_key FROM information_schema.columns WHERE table_name= 'film' and table_schema='sakila' []\n  web/models/film.ex was generated\n\n13:15:04.319 [debug] QUERY OK db=1.4ms\nSELECT COLUMN_NAME, DATA_TYPE, CASE WHEN `COLUMN_KEY` = 'PRI' THEN '1' ELSE NULL END AS primary_key FROM information_schema.columns WHERE table_name= 'film_actor' and table_schema='sakila' []\n  web/models/film_actor.ex was generated\n\n13:15:04.323 [debug] QUERY OK db=0.9ms\nSELECT COLUMN_NAME, DATA_TYPE, CASE WHEN `COLUMN_KEY` = 'PRI' THEN '1' ELSE NULL END AS primary_key FROM information_schema.columns WHERE table_name= 'film_category' and table_schema='sakila' []\n  web/models/film_category.ex was generated\n  enum is not supported ... Fallback to :string\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexandrubagu%2Fecto_generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexandrubagu%2Fecto_generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexandrubagu%2Fecto_generator/lists"}