-
-
Notifications
You must be signed in to change notification settings - Fork 121
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
This works:
>>> db['foo'].insert_all([{"name": "hello"}], pk="name")
<Table foo (name)>
But this fails:
>>> db['foo3'].upsert_all([{"name": "hello"}], pk="name")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/simon/.local/share/virtualenvs/datasette.io-TK86ygSO/lib/python3.9/site-packages/sqlite_utils/db.py", line 1837, in upsert_all
return self.insert_all(
File "/Users/simon/.local/share/virtualenvs/datasette.io-TK86ygSO/lib/python3.9/site-packages/sqlite_utils/db.py", line 1778, in insert_all
self.insert_chunk(
File "/Users/simon/.local/share/virtualenvs/datasette.io-TK86ygSO/lib/python3.9/site-packages/sqlite_utils/db.py", line 1588, in insert_chunk
result = self.db.execute(query, params)
File "/Users/simon/.local/share/virtualenvs/datasette.io-TK86ygSO/lib/python3.9/site-packages/sqlite_utils/db.py", line 213, in execute
return self.conn.execute(sql, parameters)
sqlite3.OperationalError: near "WHERE": syntax error
With the debugger:
>>> import pdb; pdb.pm()
> /Users/simon/.local/share/virtualenvs/datasette.io-TK86ygSO/lib/python3.9/site-packages/sqlite_utils/db.py(213)execute()
-> return self.conn.execute(sql, parameters)
(Pdb) print(sql, parameters)
UPDATE [foo3] SET WHERE [name] = ? ['hello']
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working