Use sql batch to optimize
This commit is contained in:
@@ -97,7 +97,7 @@ def inp_in_demand(section: list[str]) -> ChangeSet:
|
||||
return cs
|
||||
|
||||
|
||||
def inp_in_demand_new(name: str, line: str) -> None:
|
||||
def inp_in_demand_new(line: str) -> str:
|
||||
tokens = line.split()
|
||||
|
||||
num = len(tokens)
|
||||
@@ -111,7 +111,7 @@ def inp_in_demand_new(name: str, line: str) -> None:
|
||||
category = str(tokens[3]) if num_without_desc >= 4 else None
|
||||
category = f"'{category}'" if category != None else 'null'
|
||||
|
||||
write(name, f"insert into demands (junction, demand, pattern, category) values ('{junction}', {demand}, {pattern}, {category});")
|
||||
return f"insert into demands (junction, demand, pattern, category) values ('{junction}', {demand}, {pattern}, {category});"
|
||||
|
||||
|
||||
def inp_out_demand(name: str) -> list[str]:
|
||||
|
||||
Reference in New Issue
Block a user