MCPcopy Create free account
hub / github.com/daniel2005d/mapXplore / start

Method start

middle/data_importer.py:88–120  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

86 AnsiPrint.print(f"Imported [cyan]{file_name}[green] [Success][reset]"+' '*40)
87
88 def start(self):
89 old_db = SqlMapSetting().database
90 try:
91 stopwatch = Stopwatch()
92 stopwatch.start()
93
94 self._summary = {
95 "databases":[],
96 "tables":[],
97 "rows":0,
98 "files":[],
99 "elapsed":""
100
101 }
102 self._bind_config()
103 databases = SqlMapSetting().get_databases()
104 if databases is not None:
105 for name in databases:
106 SqlMapSetting().database=name
107 self._summary["databases"].append(name.lower())
108 AnsiPrint.print(f"\r\nCreating database [yellow][bold]{name.lower()}[reset]")
109
110 db = self._get_connection(Settings.get_principal_db(self._dbConfig.dbms))
111 db.create_database(name)
112 self.create_tables(name)
113
114 stopwatch.stop()
115 self._summary["elapsed"]= str(stopwatch)
116 self._print_summary()
117 except Exception as e:
118 AnsiPrint.print_error(e)
119 finally:
120 SqlMapSetting().database = old_db

Callers

nothing calls this directly

Calls 14

startMethod · 0.95
_bind_configMethod · 0.95
_get_connectionMethod · 0.95
create_tablesMethod · 0.95
stopMethod · 0.95
_print_summaryMethod · 0.95
SqlMapSettingClass · 0.90
StopwatchClass · 0.90
get_principal_dbMethod · 0.80
get_databasesMethod · 0.45
appendMethod · 0.45
printMethod · 0.45

Tested by

no test coverage detected