compare [TBL ...] compare table contents on both sides
repair [TBL ...] repair data on subscriber
execute [FILE ...] execute SQL files on set
+ show-handlers [..] show info about all or specific handler
Internal Commands:
copy copy table logic
'drop-node', 'takeover'), londiste.LondisteSetup),
(('add-table', 'remove-table', 'add-seq', 'remove-seq', 'tables', 'seqs',
'missing', 'resync', 'check', 'fkeys', 'execute'), londiste.LondisteSetup),
+ (('show-handlers',), londiste.LondisteSetup),
(('worker', 'replay'), londiste.Replicator),
(('compare',), londiste.Comparator),
(('repair',), londiste.Repairer),
'londiste': TableHandler,
}
+_handler_list = _handler_map.keys()
+
def register_handler_module(modname):
"""Import and module and register handlers."""
__import__(modname)
m = sys.modules[modname]
for h in m.__londiste_handlers__:
_handler_map[h.handler_name] = h
+ _handler_list.append(h.handler_name)
def _parse_arglist(arglist):
args = {}
for m in lst:
register_handler_module(m)
+def show(mods):
+ if not mods:
+ if 0:
+ names = _handler_map.keys()
+ names.sort()
+ else:
+ names = _handler_list
+ for n in names:
+ kls = _handler_map[n]
+ desc = kls.__doc__ or ''
+ if desc:
+ desc = desc.split('\n', 1)[0]
+ print("%s - %s" % (n, desc))
+ else:
+ for n in mods:
+ kls = _handler_map[n]
+ desc = kls.__doc__ or ''
+ if desc:
+ desc = desc.rstrip()
+ print("%s - %s" % (n, desc))
+
"""TODO: show removed triggers."""
pass
+ def cmd_show_handlers(self, *args):
+ """Show help about handlers."""
+ londiste.handler.show(args)
+
def cmd_execute(self, *files):
db = self.get_database('db')
curs = db.cursor()