Generate phoenix schemas, html, json and live from existing database
- install elixir "https://elixir-lang.org/install.html"
- install phoenix "https://hexdocs.pm/phoenix/installation.html"
mix archive.install hex phx_new
mix phx.new app_name
cd app_nameIf available in Hex, the package can be installed
by adding ex_dbmigrate to your list of dependencies in mix.exs:
def deps do
[
{:ex_dbmigrate, ">= 0.0.0"}
]
endconfig :ex_dbmigrate, ExDbmigrate.Repo,
adapter: Ecto.Adapters.Postgres,
username: "postgres",
password: "postgres",
database: "postgres",
hostname: "localhost",
pool_size: 10,
primary_key_type: :uuid
# port: 5543mix ExDbmigrate.Gen.Module
mix ExDbmigrate.Gen.Migration
mix ExDbmigrate.Gen.Relation
mix ExDbmigrate.Gen.Schema
mix ExDbmigrate.Gen.Html
mix ExDbmigrate.Gen.Json
mix ExDbmigrate.Gen.Liveiex> ExDbmigrate.json("public", :write, "json.txt")- on some distributions the mix tasks fail with a tools error, however the iex version works.
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/ex_dbmigrate.