README
author Radek Brich <radek.brich@devl.cz>
Sat, 29 Sep 2012 12:08:47 +0200
changeset 48 b82c7c2fb5af
parent 34 98c7809af415
child 76 3a41b351b122
permissions -rw-r--r--
PgManager: Fix logging, log queries before executing, possible exceptions are logged after. Add tests for RowDict. Add tests.py - runs all tests.

=========
pgtoolkit
=========

General Python Modules
----------------------

pgmanager.py - Database connection manager (pooling etc.)
pgbrowser.py - Schema browser module
pgdiff.py - Schema diff tool

Graphical and Command Line Tools
--------------------------------

pgbrowser-gtk.py - Database browser - graphical interface (GTK)
pgconsole-gtk.py - Query console - graphical interface (GTK)
pgdiff-cli.py - Command line diff tool

MySQL - mytoolkit
-----------------

Package mytoolkit contains PgManager drop-in replacement for MySQL,
MyManager. This may be useful if MySQL interoperability is needed
for some reason.

MyManager requires MySQLdb module, which works only with Python 2.5 - 2.7.
You need patch for Python 3.2 - see `extras/MySQL-python-1.2.3-python3.patch`.

MyManager may be merged into PgManager in future, but currently there
isn't any generally usable python module for MySQL. MySQLdb isn't developed
anymore thus being practically dead, while alternatives are not mature enough.

Just use PostgreSQL with Python, it's better option in most use cases.


Tools
=====

tablecopy.py
------------

./tablecapy.py db1 db2 -n
  Read all tables and all schema from db1, print table names. Remove -n to copy data to db2.

./tablecopy.py db1 db2 -s myschema
  Copy all tables in "myschema" from db1 to db2.

./tablecopy.py db1 db2 -s myschema --dst-schema otherschema
  Copy all tables in "myschema" from db1 to same tables in "otherschema" in db2.

./tablecopy.py db1 db2 -s ^my --regex
  Copy all tables from all schemas beginning with "my".

./tablecopy.py db1 db2 -s myschema1 --dst-schema myschema2 --regex -t ^my
  Copy all tables beginning with "my" from myschema1 to tables of same name in myschema2.

Rules:
  If nothing is specified, everything is copied.
  If no target schema or table is specified, data are copied to schema or table of same name.
  If --regex is specified, it applies to table name if specified, schema name otherwise.
  If both --regex and --src-table is specified, both source and dest schema can be named (no regex applied to them).
  Default schema name is '', which as regex matches all schemas. Same for table name.
  Regexes are match with source database, destination database is not checked (table may not exists, will fail when copying).
  Directly specified table name (no --regex) is not checked (may not exists).