Add any sql to batch

This commit is contained in:
WQY\qiong
2023-03-16 08:30:32 +08:00
parent 04a58bb864
commit 977e706a05

View File

@@ -216,7 +216,7 @@ def parse_file(project: str, inp: str) -> None:
if s == PATTERNS:
tokens = line.split()
if current_pattern != tokens[0]:
write(project, f"insert into _pattern (id) values ('{tokens[0]}');")
sql_batch.add(f"insert into _pattern (id) values ('{tokens[0]}');")
current_pattern = tokens[0]
elif s == CURVES:
tokens = line.split()
@@ -224,7 +224,7 @@ def parse_file(project: str, inp: str) -> None:
type = CURVE_TYPE_PUMP
if curve_type_desc_line != None:
type = curve_type_desc_line.split(':')[0].strip()
write(project, f"insert into _curve (id, type) values ('{tokens[0]}', '{type}');")
sql_batch.add(f"insert into _curve (id, type) values ('{tokens[0]}', '{type}');")
current_curve = tokens[0]
curve_type_desc_line = None