Skip to content

Commit

Permalink
Update Readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthieu committed Oct 28, 2020
1 parent 8053a74 commit e87601c
Showing 1 changed file with 31 additions and 15 deletions.
46 changes: 31 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
Cappa - Fast database snapshot and restore tool for development.
=======

Cappa allows you to quickly snapshot / revert database when you are e.g. writing database migrations, switching branches or messing with SQL. PostgreSQL only.
Cappa allows you to quickly snapshot / revert database when you are e.g. writing database migrations, switching branches or messing with SQL.

Warning : not stable yet + PostgreSQL only (at the moment).

Heavily inspired by [fastmonkeys/stellar](https://github.com/fastmonkeys/stellar)

```
Cappa allows you to take fast snapshots / restore of your development database.
Useful when you have git branches containing migrations
Heavily (98%) inspired by fastmonkeys/stellar
Usage:
cappa [command]
Available Commands:
execute Execute sql from file (default '.cappa.sql')
execute Execute sql from file (default '.cappa/execute.sql')
grab A brief description of your command
help Help about any command
list List all your snapshots
remove Remove snapshot
restore Restore from snapshot
snapshot Snapshot database
snapshot Create snapshot of development database
version Print the version number of Cappa
Flags:
-h, --help help for cappa
-v, --verbose What's wrong ? Speak to me
Use "cappa [command] --help" for more information about a command.
--config string config file (default is $HOME/.cappa.toml)
-h, --help help for cappa
-v, --verbose What's wrong ? Speak to me
```

Expand All @@ -42,12 +41,24 @@ However, Cappa uses lots of storage space so you probably don't want to make too

**Warning: Please don't use Cappa if you can't afford data loss.** It's great for developing but not meant for production.

How to get started
Installation
-------
Package management is not taking care of for now (will be HomeBrew first).

Download binary (and install in your $PATH)

https://github.com/hbyio/cappa/releases

How to take a snapshot


How to get started
-------

Cappa looks for a `DATABASE_URL` key in your environment variables or in a local .cappa.toml config file.

e.g. : `DATABASE_URL=postgres://admin:admin@127.0.0.1:5432/devdb`

How to take a snapshot`
-------

```$ cappa snapshot```
Expand All @@ -57,15 +68,20 @@ How to restore from a snapshot

```$ cappa restore```

How to restore from a dump file
Grab a fresh dump file from your s3 bucket (will be downloaded to a local .cappa directory)
-------

```$ cappa grab --bucket=safestorage --prefix=database/hourly```

Restore from a dump file stored in a '.cappa' directory
-------

```$ cappa restore dump```

If you load production data and need to run some sql before starting working (anonymisation)
-------

```$ cappa execute```
```$ cappa execute``` (will execute statements in an .cappa/execute.sql, line by line)

Common issues
-------
Expand All @@ -83,4 +99,4 @@ Todo

"Cappa" ?
-------
[Because it wants to take great snapshots](https://fr.wikipedia.org/wiki/Robert_Capa)
[Because it wants to take great snapshots](https://fr.wikipedia.org/wiki/Robert_Capa)

0 comments on commit e87601c

Please sign in to comment.