sqlx-ts
sqlx-ts copied to clipboard
[BUG] The tool detects the errors but return exit code 0 and prints "[INFO] No SQL errors detected!"
The command:
$ sqlx-ts . --db-type=postgres --db-host=localhost --db-port=5431 --db-user=<user> --db-pass=<password> && echo "Exit code is 0"
reurns:
[INFO] Scanning "." for SQLs with extension Ts
error: internal compiler error: column "jwks_ur" of relation "applications" does not exist
--> ./src/applications/applications.service.ts:18:5
|
18 | / const { rows } = await this.conn.query(
19 | | sql`
20 | | INSERT INTO applications (jwks_ur) VALUES ($1) RETURNING *;
21 | | `,
22 | | [createApplicationDto.jwksUri],
23 | | );
| |______^
[INFO] No SQL errors detected!
Exit code is 0
Thanks for this, could you please tell me what version of sqlx-ts that you are using?
I am replicating the same query (It seems like you are not using -g flag)
On the latest sqlx-ts, I am getting the exit code correctly, process.exit(1)
Also please let me know which database are you using. The command relies on whether or not the database correctly fails on the PREPARE/EXPLAIN query