mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-23 09:24:31 +02:00
Capture parameters= not params=, refs #309
This commit is contained in:
parent
14f643d9e9
commit
a6567ec507
2 changed files with 7 additions and 7 deletions
|
|
@ -795,12 +795,12 @@ def insert_upsert_implementation(
|
|||
raise click.ClickException(
|
||||
"{}\n\nTry using --alter to add additional columns".format(e.args[0])
|
||||
)
|
||||
# If we can find sql= and params= arguments, show those
|
||||
variables = _find_variables(e.__traceback__, ["sql", "params"])
|
||||
if "sql" in variables and "params" in variables:
|
||||
# If we can find sql= and parameters= arguments, show those
|
||||
variables = _find_variables(e.__traceback__, ["sql", "parameters"])
|
||||
if "sql" in variables and "parameters" in variables:
|
||||
raise click.ClickException(
|
||||
"{}\n\nsql = {}\nparams={}".format(
|
||||
str(e), variables["sql"], variables["params"]
|
||||
"{}\n\nsql = {}\nparameters = {}".format(
|
||||
str(e), variables["sql"], variables["parameters"]
|
||||
)
|
||||
)
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -1259,7 +1259,7 @@ def test_upsert_alter(db_path, tmpdir):
|
|||
assert (
|
||||
"Error: no such column: age\n\n"
|
||||
"sql = UPDATE [dogs] SET [age] = ? WHERE [id] = ?\n"
|
||||
"params=[5, 1]"
|
||||
"parameters = [5, 1]"
|
||||
) == result.output.strip()
|
||||
# Should succeed with --alter
|
||||
result = CliRunner().invoke(
|
||||
|
|
@ -2321,5 +2321,5 @@ def test_integer_overflow_error(tmpdir):
|
|||
assert result.output == (
|
||||
"Error: Python int too large to convert to SQLite INTEGER\n\n"
|
||||
"sql = INSERT INTO [items] ([bignumber]) VALUES (?);\n"
|
||||
"params=[34223049823094832094802398430298048240]\n"
|
||||
"parameters = [34223049823094832094802398430298048240]\n"
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue