mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-09-28 04:44:26 +02:00
Applied Black
This commit is contained in:
parent
e51bd09a35
commit
71a3bc26c9
2 changed files with 7 additions and 2 deletions
|
|
@ -302,7 +302,9 @@ def insert_upsert_options(fn):
|
||||||
),
|
),
|
||||||
click.argument("table"),
|
click.argument("table"),
|
||||||
click.argument("json_file", type=click.File(), required=True),
|
click.argument("json_file", type=click.File(), required=True),
|
||||||
click.option("--pk", help="Columns to use as the primary key, e.g. id", multiple=True),
|
click.option(
|
||||||
|
"--pk", help="Columns to use as the primary key, e.g. id", multiple=True
|
||||||
|
),
|
||||||
click.option("--nl", is_flag=True, help="Expect newline-delimited JSON"),
|
click.option("--nl", is_flag=True, help="Expect newline-delimited JSON"),
|
||||||
click.option("-c", "--csv", is_flag=True, help="Expect CSV"),
|
click.option("-c", "--csv", is_flag=True, help="Expect CSV"),
|
||||||
click.option(
|
click.option(
|
||||||
|
|
|
||||||
|
|
@ -429,7 +429,10 @@ def test_insert_multiple_with_primary_key(db_path, tmpdir):
|
||||||
|
|
||||||
def test_insert_multiple_with_compound_primary_key(db_path, tmpdir):
|
def test_insert_multiple_with_compound_primary_key(db_path, tmpdir):
|
||||||
json_path = str(tmpdir / "dogs.json")
|
json_path = str(tmpdir / "dogs.json")
|
||||||
dogs = [{"breed": "mixed", "id": i, "name": "Cleo {}".format(i), "age": i + 3} for i in range(1, 21)]
|
dogs = [
|
||||||
|
{"breed": "mixed", "id": i, "name": "Cleo {}".format(i), "age": i + 3}
|
||||||
|
for i in range(1, 21)
|
||||||
|
]
|
||||||
open(json_path, "w").write(json.dumps(dogs))
|
open(json_path, "w").write(json.dumps(dogs))
|
||||||
result = CliRunner().invoke(
|
result = CliRunner().invoke(
|
||||||
cli.cli, ["insert", db_path, "dogs", json_path, "--pk", "id", "--pk", "breed"]
|
cli.cli, ["insert", db_path, "dogs", json_path, "--pk", "id", "--pk", "breed"]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue