diff options
Diffstat (limited to 'python')
| -rwxr-xr-x | python/londiste.py | 4 | ||||
| -rw-r--r-- | python/londiste/setup.py | 7 |
2 files changed, 10 insertions, 1 deletions
diff --git a/python/londiste.py b/python/londiste.py index 7584e59f..e973392d 100755 --- a/python/londiste.py +++ b/python/londiste.py @@ -116,8 +116,10 @@ class Londiste(skytools.DBScript): help = "add: create table/seq if not exist") g.add_option("--create-only", help = "add: create table/seq if not exist (seq,pkey,full,indexes,fkeys)") + g.add_option("--trigger-flags", + help="add: Set trigger flags (BAIUDLQ)") g.add_option("--trigger-arg", action="append", - help="add: Custom trigger arg") + help="add: Custom trigger arg (can be specified multiply times)") g.add_option("--handler", action="append", help="add: Custom handler for table") g.add_option("--copy-condition", dest="copy_condition", diff --git a/python/londiste/setup.py b/python/londiste/setup.py index 48335867..a323ab20 100644 --- a/python/londiste/setup.py +++ b/python/londiste/setup.py @@ -56,6 +56,8 @@ class LondisteSetup(CascadeAdmin): help="include all tables", default=False) p.add_option("--create-only", help="pkey,fkeys,indexes") + p.add_option("--trigger-flags", + help="Set trigger flags (BAIUDLQ)") p.add_option("--trigger-arg", action="append", help="Custom trigger arg") p.add_option("--handler", action="append", @@ -168,7 +170,12 @@ class LondisteSetup(CascadeAdmin): attrs['handlers'] = ":".join(hlist) # actual table registration + tgflags = self.options.trigger_flags tgargs = self.options.trigger_arg # None by default + if tgflags: + if not tgargs: + tgargs = [] + tgargs.append('tgflags='+tgflags) q = "select * from londiste.local_add_table(%s, %s, %s)" self.exec_cmd(dst_curs, q, [self.set_name, tbl, tgargs]) |
