Use sql batch to optimize
This commit is contained in:
@@ -97,7 +97,8 @@ def inp_in_time(section: list[str]) -> ChangeSet:
|
||||
return ChangeSet()
|
||||
|
||||
|
||||
def inp_in_time_new(name: str, section: list[str]) -> None:
|
||||
def inp_in_time_new(section: list[str]) -> str:
|
||||
sql = ''
|
||||
for s in section:
|
||||
if s.startswith(';'):
|
||||
continue
|
||||
@@ -106,7 +107,8 @@ def inp_in_time_new(name: str, section: list[str]) -> None:
|
||||
for key in get_time_schema('').keys():
|
||||
if line.startswith(key):
|
||||
value = line.removeprefix(key).strip()
|
||||
write(name, f"update times set value = '{value}' where key = '{key}';")
|
||||
sql += f"update times set value = '{value}' where key = '{key}';"
|
||||
return sql
|
||||
|
||||
|
||||
def inp_out_time(name: str) -> list[str]:
|
||||
|
||||
Reference in New Issue
Block a user