Skip to content

Latest commit

 

History

History
58 lines (46 loc) · 1.15 KB

File metadata and controls

58 lines (46 loc) · 1.15 KB

Dbmodel

Generate schema model from database

Installation

If available in Hex, the package can be installed by adding dbmodel to your list of dependencies in mix.exs:

def deps do
  [
    {:dbmodel, "~> 0.1.0"}
  ]
end

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

Configuration

Append the below config into config/. It can placed config.exs or develop.exs

config :dbmodel,
  module_name: "Aharooms.Api.Schema",
  destination: "gen/",
  host: "localhost",
  port: "5432",
  dbname: "aharooms_dev",
  username: "postgres",
  password: "postgres",
  type: :postgres
  • module_name: name for generating the package's file
  • destination: location to storing the schema files
  • host: db host
  • port: db port
  • dbname: database name
  • username: db username
  • password: db password
  • type:
    • :postgres
    • :mysql

Generate schema

mix gen.schema

Generate django

mix gen.django