Closed mrlee14 closed 3 months ago
I could not reproduce the issue.
live_data
table?live_data
table? You can check this via the Schema button in the UI.I could not reproduce the issue.
- Could you provide the schema of the
live_data
table?- Additionally, is there a trigger attached to the
live_data
table? You can check this via the Schema button in the UI.
NOTE: insert statements i execute by <shift+enter>
Schema: CREATE TABLE live_data ( ffmpeg_pid INTEGER, live_id TEXT, service TEXT, origin TEXT, option TEXT, date INTEGER, real_stat INTEGER )
Triger: None found
Thank you, I now understand your question. The query editor does not support placeholders, so the correct query would be:
INSERT INTO live_data ("ffmpeg_pid", "live_id", "service", "origin", "option", "date", "real_stat")
VALUES (12345, 'asdadas', 'youtube', 'scheduler', NULL, 1723072696, 1723072699);
What was happening in your original query is that in SQLite, a VALUES clause can make multiple rows by separating them with commas, like this:
sqlite> VALUES (1, 2), (3, 4), (5, 6);
column1
---
1|2
3|4
5|6
It seems SQLite treats unbound placeholders as NULL, so (?, ?, ?, ?, ?, ?, ?) is inserting 7 NULLs.
version: v1.0.189
EXAMPLE: INSERT INTO live_data ("ffmpeg_pid", "live_id", "service", "origin", "option", "date", "real_stat") VALUES (?, ?, ?, ?, ?, ?, ?), (12345, "asdadas", "youtube", "scheduler", NULL, 1723072696, 1723072699);
RESULT: [{"ffmpeg_pid":12345,"live_id":"asdadas","service":"youtube","origin":"scheduler","option":null,"date":1723072696,"real_stat":1723072699}]
plus one extra row each time: [{"live_id":null},{"ffmpeg_pid":null},{"service":null},{"origin":null},{"option":null},{"date":null},{"real_stat":null}]
Quetsion: Is this bug or I have some unknown option set????