mirror of
https://github.com/correl/mtgsqlive.git
synced 2024-11-28 19:19:52 +00:00
Commit bug fix (#51)
This commit is contained in:
parent
03cd07af3b
commit
13d2a09b7f
1 changed files with 4 additions and 10 deletions
|
@ -47,6 +47,10 @@ def execute(input_file, output_file, extras=False) -> None:
|
||||||
build_sql_schema(json_data, output_file)
|
build_sql_schema(json_data, output_file)
|
||||||
parse_and_import_cards(json_data, input_file, output_file)
|
parse_and_import_cards(json_data, input_file, output_file)
|
||||||
parse_and_import_extras(input_file, output_file)
|
parse_and_import_extras(input_file, output_file)
|
||||||
|
if output_file["path"].suffix == ".sql":
|
||||||
|
output_file["handle"].write("COMMIT;")
|
||||||
|
else:
|
||||||
|
output_file["handle"].commit()
|
||||||
output_file["handle"].close()
|
output_file["handle"].close()
|
||||||
|
|
||||||
|
|
||||||
|
@ -396,11 +400,6 @@ def parse_and_import_cards(
|
||||||
)
|
)
|
||||||
sql_dict_insert(set_translation_attr, "set_translations", output_file)
|
sql_dict_insert(set_translation_attr, "set_translations", output_file)
|
||||||
|
|
||||||
if output_file["path"].suffix == ".sql":
|
|
||||||
output_file["handle"].write("COMMIT;")
|
|
||||||
else:
|
|
||||||
output_file["handle"].commit()
|
|
||||||
|
|
||||||
|
|
||||||
def parse_and_import_extras(input_file: pathlib.Path, output_file: Dict) -> None:
|
def parse_and_import_extras(input_file: pathlib.Path, output_file: Dict) -> None:
|
||||||
"""
|
"""
|
||||||
|
@ -488,11 +487,6 @@ def parse_and_import_extras(input_file: pathlib.Path, output_file: Dict) -> None
|
||||||
output_file,
|
output_file,
|
||||||
)
|
)
|
||||||
|
|
||||||
if output_file["path"].suffix == ".sql":
|
|
||||||
output_file["handle"].write("COMMIT;")
|
|
||||||
else:
|
|
||||||
output_file["handle"].commit()
|
|
||||||
|
|
||||||
|
|
||||||
def sql_insert_all_card_fields(
|
def sql_insert_all_card_fields(
|
||||||
card_attributes: Dict[str, Any], output_file: Dict
|
card_attributes: Dict[str, Any], output_file: Dict
|
||||||
|
|
Loading…
Reference in a new issue