fix formatted string
This commit is contained in:
parent
69a8fbe7d8
commit
6189ceb4ac
@ -55,12 +55,13 @@ def dump(dumpfile=DUMPFILE):
|
|||||||
try:
|
try:
|
||||||
with open(dumpfile, "r") as f:
|
with open(dumpfile, "r") as f:
|
||||||
a = json.load(f)
|
a = json.load(f)
|
||||||
for database,values in a.items():
|
for database, values in a.items():
|
||||||
print(f"--- database {database} ---")
|
print(f"--- database {database} ---")
|
||||||
print("{};\n".format(values["ddl"]))
|
create_database = values["ddl"]
|
||||||
for table,c in values["tables"].items():
|
print(f"{create_database};\n")
|
||||||
|
for table, create_table in values["tables"].items():
|
||||||
print(f"-- table {database}.{table} --")
|
print(f"-- table {database}.{table} --")
|
||||||
print(f"{c};\n")
|
print(f"{create_table};\n")
|
||||||
except FileNotFoundError as e:
|
except FileNotFoundError as e:
|
||||||
print(e)
|
print(e)
|
||||||
print("-- to re-create replicas, run 'clickhouse-client --multiquery < generated_file.sql' on new replica server")
|
print("-- to re-create replicas, run 'clickhouse-client --multiquery < generated_file.sql' on new replica server")
|
||||||
|
Loading…
Reference in New Issue
Block a user