# Overview

Development command to create a database schema dump (using current service
config) and put it into `src/generated/db/schema.sql` file of the current
project.

Environment variables must be pre-loaded so that a database connection string
could be constructed.

Shadow database is used as a target to provide a clean schema dump. Shadow
database is re-created on each migration commit, migration uncommit, and
database reset in development as a testing ground for migrations, so it always
has up-to-date schema without unexpected changes.

Example call with preload can look like this:
`dotenv -- mosaic pg-dump -c scripts/infra`, where `dotenv` is a cli command to
load environment variables using `dotenv-cli` npm package. Alternatively,
`env-cmd` or some other tool can be used instead of `dotenv`

Example call without preload can look like this:
`mosaic pg-dump -c scripts/infra -s postgres://username:password@localhost:5432/database_name`
