Commit 620f602b authored by Glandos's avatar Glandos
Browse files

improve doc

parent 92774e7f
......@@ -3,10 +3,18 @@ Merge magnetico databases
Very simple script to merge databases created by [magnetico](https://github.com/boramalper/magnetico) >=0.8
It supports merging SQLite database into SQLite or PostgreSQL.
Merging *from* PostgreSQL might work, but I didn't try it, yet.
```
Usage: magnetico_merge.py [OPTIONS] MAIN_DB MERGED_DB
Options:
--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.
--help Show this message and exit.
```
......@@ -14,4 +22,6 @@ The `MERGED_DB` will be merged into `MAIN_DB`.
It requires python >= 3.6 and [click](https://click.palletsprojects.com/en/7.x/)
If you need to import into 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.
Have fun.
......@@ -24,12 +24,6 @@ try:
except ImportError:
pgcopy = None
# 4204942: b'\x00\x00\x02\x0100\x00'
# 10196786: b'\xff\xfe1\x00'
# [#############################################################----------------] 4204000/14135209 05:42:40Removing null bytes from 1000 rows
# [################################################################-------------] 4416000/14135209 05:43:0
"""
Schema:
CREATE TABLE torrents (
......@@ -468,7 +462,7 @@ class PostgreSQL(Database):
@click.option(
"--fast",
is_flag=True,
help="Try to go faster, by deleting indices and removing WAL while importing. PostgreSQL only.",
help="Try to go faster, by deleting indices and constraints while importing. PostgreSQL only. This can be really slower if your databases overlapped a lot.",
)
@click.argument("main-db")
@click.argument("merged-db")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment