mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-09-07 00:54:20 +02:00
bulk --functions, closes #471
This commit is contained in:
parent
59e2cfbdc1
commit
23ef1d6c20
3 changed files with 14 additions and 3 deletions
|
|
@ -28,9 +28,11 @@ def test_cli_bulk(test_db_and_path):
|
|||
[
|
||||
"bulk",
|
||||
db_path,
|
||||
"insert into example (id, name) values (:id, :name)",
|
||||
"insert into example (id, name) values (:id, myupper(:name))",
|
||||
"-",
|
||||
"--nl",
|
||||
"--functions",
|
||||
"myupper = lambda s: s.upper()",
|
||||
],
|
||||
input='{"id": 3, "name": "Three"}\n{"id": 4, "name": "Four"}\n',
|
||||
)
|
||||
|
|
@ -38,8 +40,8 @@ def test_cli_bulk(test_db_and_path):
|
|||
assert [
|
||||
{"id": 1, "name": "One"},
|
||||
{"id": 2, "name": "Two"},
|
||||
{"id": 3, "name": "Three"},
|
||||
{"id": 4, "name": "Four"},
|
||||
{"id": 3, "name": "THREE"},
|
||||
{"id": 4, "name": "FOUR"},
|
||||
] == list(db["example"].rows)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue