Skip to content

hieuphq/dbmodel-ex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

generate ecto schema from db structure

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published