schemadiff.py
changeset 61 703bba757605
parent 56 94e091c23ebb
child 63 8c7f0a51ba50
equal deleted inserted replaced
60:bb6b20106ff5 61:703bba757605
    23         srcbrowser = pgbrowser.PgBrowser(self.pgm.get_conn('src'))
    23         srcbrowser = pgbrowser.PgBrowser(self.pgm.get_conn('src'))
    24         dstbrowser = pgbrowser.PgBrowser(self.pgm.get_conn('dst'))
    24         dstbrowser = pgbrowser.PgBrowser(self.pgm.get_conn('dst'))
    25 
    25 
    26         pgd = pgdiff.PgDiff(srcbrowser, dstbrowser)
    26         pgd = pgdiff.PgDiff(srcbrowser, dstbrowser)
    27 
    27 
    28         if self.args.schema:
    28         try:
    29             pgd.filter_schemas(include=self.args.schema)
    29             if self.args.schema:
       
    30                 pgd.filter_schemas(include=self.args.schema)
    30 
    31 
    31         if self.args.table:
    32             if self.args.table:
    32             pgd.filter_tables(include=self.args.table)
    33                 pgd.filter_tables(include=self.args.table)
    33 
    34 
    34         if self.args.sql:
    35             if self.args.sql:
    35             pgd.print_patch()
    36                 pgd.print_patch()
    36         else:
    37             else:
    37             pgd.print_diff()
    38                 pgd.print_diff()
       
    39         except pgdiff.PgDiffError as e:
       
    40             print('PgDiff error:', str(e))
    38 
    41 
    39 
    42 
    40 tool = SchemaDiffTool()
    43 tool = SchemaDiffTool()
    41 tool.main()
    44 tool.main()