Esempio n. 1
0
 def output(cls, ns, explorer):
     if ns.catalog["format"] == "ascii_table":
         headers = ["schema", "table", "column", "has_pii"]
         tableprint.table(explorer.get_tabular(ns.list_all), headers)
     elif ns.catalog["format"] == "json":
         FileStore.save_schemas(explorer)
     elif ns.catalog["format"] == "db":
         DbStore.save_schemas(explorer)
Esempio n. 2
0
 def output(cls, ns, explorer):
     if ns.output_format == "ascii_table":
         headers = ["schema", "table", "column", "has_pii"]
         tableprint.table(explorer.get_tabular(ns.list_all), headers)
     elif ns.output_format == "json":
         print(json.dumps(explorer.get_dict(), sort_keys=True, indent=2, cls=PiiTypeEncoder))
     elif ns.output_format == "db":
         DbStore.save_schemas(explorer)
Esempio n. 3
0
    def setUpClass(cls):
        init_test(cls.sqlite_path)

        explorer = MockExplorer(
            Namespace(catalog=None,
                      include_schema=(),
                      exclude_schema=(),
                      include_table=(),
                      exclude_table=()))

        DbStore.save_schemas(explorer)
Esempio n. 4
0
    def setUpClass(cls):
        init_test(cls.sqlite_path)

        explorer = MockExplorer(Namespace(catalog=None))

        DbStore.save_schemas(explorer)