Use sql batch to optimize

This commit is contained in:
WQY\qiong
2023-03-16 08:30:04 +08:00
parent 1d2ac09c92
commit 04a58bb864
29 changed files with 145 additions and 105 deletions

View File

@@ -124,7 +124,7 @@ def inp_in_label(section: list[str]) -> ChangeSet:
return cs
def inp_in_label_new(name: str, line: str) -> None:
def inp_in_label_new(line: str) -> str:
tokens = line.split()
num = len(tokens)
@@ -137,7 +137,7 @@ def inp_in_label_new(name: str, line: str) -> None:
node = str(tokens[3]) if num >= 4 else None
node = f"'{node}'" if node != None else 'null'
write(name, f"insert into labels (x, y, label, node) values ({x}, {y}, '{label}', {node});")
return f"insert into labels (x, y, label, node) values ({x}, {y}, '{label}', {node});"
def inp_out_label(name: str) -> list[str]: