Run Monstarillo
Generate code by running Monstarillo.
The final step is to run monstarillo. To do so you will need six pieces of information.
- The location of the templates.json file.
- A database user name. Our database user name is postgres
- A database password.
- The name of the database. Our database name is chinhook-db
- The database host. We will be using localhost as we are running postgres in docker.
- 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"
Option | Description |
---|---|
postgres | Tells Monstarillo that we are connecting to postgres |
–t | The location of the templates.json file. Configures Monstarillo |
–u | Database user name |
–p | Database password |
–db | Database name |
–host | Database host name or ip address |
–schema | Database 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