on 08-15-2022 8:04 AM
When executing queries we receive errors like:
[cds] - SQLITE_CONSTRAINT: FOREIGN KEY constraint failed in:
COMMIT
at /home/node/app/node_modules/@sap/cds/libx/_runtime/sqlite/execute.js:43:15
at new Promise (<anonymous>)
at _executeSimpleSQL (/home/node/app/node_modules/@sap/cds/libx/_runtime/sqlite/execute.js:42:10)
at executePlainSQL (/home/node/app/node_modules/@sap/cds/libx/_runtime/sqlite/execute.js:199:10)
at SQLiteDatabase._run (/home/node/app/node_modules/@sap/cds/libx/_runtime/db/query/run.js:5:12)
at SQLiteDatabase.<anonymous> (/home/node/app/node_modules/@sap/cds/libx/_runtime/sqlite/Service.js:57:19)
at next (/home/node/app/node_modules/@sap/cds/lib/serve/Service-dispatch.js:70:36)
at SQLiteDatabase.handle (/home/node/app/node_modules/@sap/cds/lib/serve/Service-dispatch.js:74:6)
at async SQLiteDatabase.commit (/home/node/app/node_modules/@sap/cds/libx/_runtime/db/Service.js:69:5)
at async SQLiteDatabase.commit (/home/node/app/node_modules/@sap/cds/lib/serve/Transaction.js:70:34) {
errno: 19,
code: 'SQLITE_CONSTRAINT',
query: 'COMMIT',
id: '1071256',
level: 'ERROR',
timestamp: 1660546526449
}
In our case we're running multiple queries. We have enabled query debugging which is nicely displaying our queries. But it seems the error occurs during the final commit. It doesn't show which query was the one that failed.
Is there some way we can have CDS/SQLite provide more detailed debugging information?
Hi,
unfortunately, the error messages for integrity violations are passed to you as they come from the database.
This is also documented in capire.
Best Regards,
Patrice
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
69 | |
8 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.