ExDbmigrate

Hex DocsHex.pmLicenseLast UpdatedBuild Status

Generate ash resources, phoenix schemas, html, json and live from existing database

Installation

 mix archive.install hex phx_new
 mix phx.new app_name
 cd app_name

If 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"}
  ]
end

Configuration

config :ex_dbmigrate, ExDbmigrate.Repo,
  adapter: Ecto.Adapters.Postgres,
  username: "postgres",
  password: "postgres",
  database: "postgres",
  hostname: "localhost",
  pool_size: 10,
  primary_key_type: :uuid
#   port: 5543

Usage:

mix 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.Live
mix ExDbmigrate.Gen.Resource

Usage Inside iex: (/priv/json.txt will be created)

iex> ExDbmigrate.json("public", :write, "json.txt")

Caveats:

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/ex_dbmigrate.