diff options
| author | Marko Kreen | 2010-11-12 14:20:40 +0000 |
|---|---|---|
| committer | Marko Kreen | 2010-11-26 11:26:09 +0000 |
| commit | d05ab06d3956627c8808dc2566c73785c98e9959 (patch) | |
| tree | 53e041e87102a92565a3af709aac2d72dca26797 /python | |
| parent | d0dbd8abec1a65612a99fb56d9d68d59cc6604aa (diff) | |
londiste: trigger flags to control trigger creation
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]) |
