SendOutCards / transplant

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

transplant

Library for selectively seeding a target database from another with the same table schemas.

Basic Usage

from transplant import transplant
from transplant.handlers import where, where_in

transplant(
    [
        {'table': 'one', 'select_handler': where('id > 100 and id < 200')},
        # gets rows from two that are represented in the one.two_id fk
        ('table': 'two', 'select_handler': where_in('one', ['two_id'], 'id'))
    ],
    from_uri='postgres://<user>:<password>@<host>:<port>/<database>',
    to_uri='postgres://<user>:<password>@<host>:<port>/<database>'
)

About

License:MIT License


Languages

Language:Python 96.1%Language:Makefile 3.9%