Run Monstarillo

Generate code by running Monstarillo.

The final step is to run monstarillo. To do so you will need six pieces of information.

  1. The location of the templates.json file.
  2. A database user name. Our database user name is postgres
  3. A database password.
  4. The name of the database. Our database name is chinhook-db
  5. The database host. We will be using localhost as we are running postgres in docker.
  6. The name of the database schema. Our database schema is “public”

Use this information to build the command.

monstarillo postgres \
--t /home/patrick/code/monstarillo-templates/tutorial-database-documenter/templates.json\
 --u postgres \
 --p <yourPassword> \
 --db "chinhook-db" \
 --host "localhost" \
 --schema "public"
OptionDescription
postgresTells Monstarillo that we are connecting to postgres
–tThe location of the templates.json file. Configures Monstarillo
–uDatabase user name
–pDatabase password
–dbDatabase name
–hostDatabase host name or ip address
–schemaDatabase schema

Run the command to generate your code. Your output will be similar to:

postgres is in the building
Processing table: Artist
Processing table: Album
Processing table: Employee
Processing table: Customer
Processing table: Invoice
Processing table: InvoiceLine
Processing table: Track
Processing table: Playlist
Processing table: PlaylistTrack
Processing table: Genre
Processing table: MediaType
Processing template: /home/patrick/code/templates/tutorial-database-documenter/table.tmpl

Your generated code will be in the OutputPath folder you set in the templates.json