mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-09-13 20:14:24 +02:00
WIP new upsert implementation, refs #652
This commit is contained in:
parent
55047db798
commit
fe3a3d4000
4 changed files with 195 additions and 112 deletions
|
|
@ -1117,9 +1117,8 @@ def test_upsert_alter(db_path, tmpdir):
|
|||
)
|
||||
assert result.exit_code == 1
|
||||
assert (
|
||||
"Error: no such column: age\n\n"
|
||||
"sql = UPDATE [dogs] SET [age] = ? WHERE [id] = ?\n"
|
||||
"parameters = [5, 1]"
|
||||
"Error: table dogs has no column named age\n\n"
|
||||
"Try using --alter to add additional columns"
|
||||
) == result.output.strip()
|
||||
# Should succeed with --alter
|
||||
result = CliRunner().invoke(
|
||||
|
|
@ -2248,7 +2247,7 @@ def test_integer_overflow_error(tmpdir):
|
|||
assert result.exit_code == 1
|
||||
assert result.output == (
|
||||
"Error: Python int too large to convert to SQLite INTEGER\n\n"
|
||||
"sql = INSERT INTO [items] ([bignumber]) VALUES (?);\n"
|
||||
"sql = INSERT INTO [items] ([bignumber]) VALUES (?)\n"
|
||||
"parameters = [34223049823094832094802398430298048240]\n"
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ def test_tracer():
|
|||
("select name from sqlite_master where type = 'view'", None),
|
||||
("CREATE TABLE [dogs] (\n [name] TEXT\n);\n ", None),
|
||||
("select name from sqlite_master where type = 'view'", None),
|
||||
("INSERT INTO [dogs] ([name]) VALUES (?);", ["Cleopaws"]),
|
||||
("INSERT INTO [dogs] ([name]) VALUES (?)", ["Cleopaws"]),
|
||||
("select name from sqlite_master where type = 'view'", None),
|
||||
(
|
||||
"CREATE VIRTUAL TABLE [dogs_fts] USING FTS5 (\n [name],\n content=[dogs]\n)",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue