Skip to content

Commit

Permalink
Add tutorial section to docs/README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-farries committed Sep 27, 2023
1 parent bd429b2 commit 8d789a9
Showing 1 changed file with 38 additions and 1 deletion.
39 changes: 38 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,44 @@

## Installation

## Getting started
## Tutorial

This section will walk you through applying your first migrations using `pgroll`.

Prerequisites:

* `pgroll` installed and accessible somewhere on your `$PATH`
* A fresh Postgres instance against which to run migrations.

A good way to get a throw-away Postgres instance for use in the tutorial is to use [Docker](https://www.docker.com/). Start a Postgres instance in Docker with:

```
docker run --rm --name for-pgroll -e POSTGRES_PASSWORD=postgres -p 5432:5432 -d postgres:16
```

The remainder of the tutorial assumes that you have a local Postgres instance accessible on port 5432.

### Initialization

`pgroll` needs to store its own internal state somewhere in the target Postgres instance. Initializing `pgroll` configures this store and makes `pgroll` ready for first use:

```
pgroll init
```

You should see a success message indicating that `pgroll` has been configured.

<details>
<summary>**What data does pgroll store**?</summary>

## Heading
1. A numbered list item
2. Another numbered list item

```go
fmt.Println("Hello, world!")
```
</details>

## Command line reference

Expand Down

0 comments on commit 8d789a9

Please sign in to comment.