Skip to content

Commit

Permalink
docs: README
Browse files Browse the repository at this point in the history
  • Loading branch information
thoas committed Dec 18, 2020
1 parent fdf261c commit 40d48f7
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
# mover

`mover` is a simple utility to extract data from a backup server and load them in your local database.
`mover` is a simple utility to extract data from a remote database server and load them in another environment.

It uses the underlying introspection API from your RDMS to retrieve automatically relationships from the extracted rows.
It uses the underlying introspection API from the RDMS to retrieve relationships from the extracted results.

## How do we use it internally?

Instead of harcoding fixtures for each workflows, we export data from our production database by sanitizing
sensible data (password, personal user information, etc.).

Thanks to this tool, we don't have to maintain anymore fixtures and we can
quickly reply production bugs in our local environment.

## Usage

Expand All @@ -21,11 +29,11 @@ mkdir -p output
Extract data from backup database:

```console
go run cmd/mover/main.go -dsn "postgresql://user:password@localhost:5433/dbname" -path output -action extract -query "SELECT * FROM user WHERE id = 1" -table "user"
go run cmd/mover/main.go -dsn "postgresql://user:password@remote.server:5432/dbname" -path output -action extract -query "SELECT * FROM user WHERE id = 1" -table "user"
```

Load data to your local database:

```console
go run cmd/mover/main.go -dsn "postgresql://user:password@localhost:5433/dbname" -path output -action load
go run cmd/mover/main.go -dsn "postgresql://user:password@localhost:5432/dbname" -path output -action load
```

0 comments on commit 40d48f7

Please sign in to comment.