README.md 907 Bytes
Newer Older
Glandos's avatar
Glandos committed
1
2
3
Merge magnetico databases
=========================

Glandos's avatar
Glandos committed
4
Very simple script to merge databases created by [magnetico](https://github.com/boramalper/magnetico) >=0.8
Glandos's avatar
Glandos committed
5

6
It supports merging SQLite database into SQLite or PostgreSQL, or merging PostgreSQL into SQLite.
Glandos's avatar
Glandos committed
7
8
9
10
```
Usage: magnetico_merge.py [OPTIONS] MAIN_DB MERGED_DB

Options:
Glandos's avatar
Glandos committed
11
12
13
14
  --fast  Try to go faster, by deleting indices and constraints while
          importing. PostgreSQL only. This can be really slower if your
          databases overlapped a lot.

Glandos's avatar
Glandos committed
15
16
17
18
19
20
21
  --help  Show this message and exit.
```

The `MERGED_DB` will be merged into `MAIN_DB`.

It requires python >= 3.6 and [click](https://click.palletsprojects.com/en/7.x/)

22
If you need to import into or load from PostgreSQL, you need to have [psycopg2](https://www.psycopg.org/). Having [pgcopy](https://github.com/altaurog/pgcopy) is faster when a lot of rows are in the `files` table.
Glandos's avatar
Glandos committed
23

Glandos's avatar
typo    
Glandos committed
24
Have fun.