Closed gussmith23 closed 7 years ago
Please help me fix this for you:
Thanks
OS: Raspbian, Raspberry Pi (ARM chip) SQLite: 3.7.13 dblite: 0.7.6
The code snippet that fails:
db.query(
'PRAGMA foreign_keys = ON;' + // Turn on foreign key constraints. Must be done here in the query!
'INSERT INTO fact (uid) VALUES (?)',
[uid],
function(err,data) { // Note: have to put data argument in here to get err object. (with single arg, it's func(data))
updateIndex();
/**
* TODO
* Ideally, we'd check for INSERT failures due to foreign key constraints.
* These failures happen when we log a lap for a non-registered team.
* An error will come up in the server's output: "Error: near line ?: foreign key constraint failed"
* However, we'd like to detect this (so we don't waste time updating everything!)
* The good news is that these records still aren't added in.
*/
});
uhm ... I'm quite over-busy these days, but I've got more than a Pi to test this stuff.
If you could provide a failure test that includes table creation IF present and stuff it would help.
I do hope this is not one of those cases where no matter what I do, sqlite dumps the output in the log/stdout instead of stderr ... I hope I am wrong.
no reply for long time
If an INSERT fails due to foreign key constraints, a message is printed to say that the INSERT didn't happen; however, the "err" object in the callback is still null.