Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] The tool detects the errors but return exit code 0 and prints "[INFO] No SQL errors detected!" #192

Open
ahmdssi opened this issue Sep 27, 2024 · 1 comment

Comments

@ahmdssi
Copy link

ahmdssi commented Sep 27, 2024

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
@JasonShin
Copy link
Owner

JasonShin commented Oct 4, 2024

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)

Screen Shot 2024-10-05 at 9 57 43 am Screen Shot 2024-10-05 at 9 56 48 am

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants