runquery.py
changeset 86 b61b54aa9f96
parent 78 64c62ac8f65d
child 90 43e5d2cf4ddb
equal deleted inserted replaced
85:11a282e23e0d 86:b61b54aa9f96
    18         toolbase.ToolBase.__init__(self, name='runquery', desc='Run configured queries.')
    18         toolbase.ToolBase.__init__(self, name='runquery', desc='Run configured queries.')
    19         self.parser.add_argument('target', nargs='?', metavar='target', type=str, help='Target database')
    19         self.parser.add_argument('target', nargs='?', metavar='target', type=str, help='Target database')
    20         self.parser.add_argument('-c', dest='config', type=str, help='Additional config file (besides pgtoolkit.conf).')
    20         self.parser.add_argument('-c', dest='config', type=str, help='Additional config file (besides pgtoolkit.conf).')
    21         self.parser.add_argument('-q', dest='queries', metavar='QUERY', nargs='*', help='Queries to run.')
    21         self.parser.add_argument('-q', dest='queries', metavar='QUERY', nargs='*', help='Queries to run.')
    22 
    22 
    23         self.config.add_argument('target', type=str, default=None)
    23         self.config.add_option('target', type=str, default=None)
    24         self.config.add_argument('queries', type=list, default=[])
    24         self.config.add_option('queries', type=list, default=[])
    25         self.config.add_argument('log_path', type=str)
    25         self.config.add_option('log_path', type=str)
    26 
    26 
    27         self.target_isolation_level = 'autocommit'
    27         self.target_isolation_level = 'autocommit'
    28 
    28 
    29         self.init()
    29         self.init()
    30 
    30