Environment variables

Connection strings: https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING

Workflow

Install pgfine

pgfine is not yet published at crates.io so you should install it from git repository: bash git clone https://gitlab.com/mrsk/pgfine cargo install --path ./pgfine

Create new project

```bash export PGFINECONNECTIONSTRING="..." export PGFINEADMINCONNECTION_STRING="..."

export PGFINE_DIR="./pgfine"

`` - Runpgfine init - Modify newly created./pgfine/create.sql` if needed.

Create a database

bash source env-local-db-0.sh pgfine migrate

Making changes to database

Table constraints should be stored along with tables. You will have a problem if constraints form circular dependencies.

Commands

pgfine init [./pgfine]

pgfine create

pgfine migrate

pgfine drop --no-joke

Structure

Files

pgfine_objects table

Contains a list of managed pgfine objects and their hashes.

pgfine_migrations table

Contains a list of executed migrations. Selecting the max value should reveal the current state of database.

Assumptions

Plan