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

@@ -27,11 +27,11 @@ def inp_in_coord(section: list[str]) -> dict[str, dict[str, float]]:
return coords
def inp_in_coord_new(name: str, line: str) -> None:
def inp_in_coord_new(line: str) -> str:
tokens = line.split()
node = tokens[0]
coord = f"'({tokens[1]}, {tokens[2]})'"
write(name, f"insert into coordinates (node, coord) values ('{node}', {coord});")
return f"insert into coordinates (node, coord) values ('{node}', {coord});"
def inp_out_coord(name: str) -> list[str]: