-
Notifications
You must be signed in to change notification settings - Fork 98
Better reporting for database connection issues #344
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
Comments
Thanks for reporting! Can you share a bit about your setup / config / logs? This is definitely not normal. |
Sure: version: 0.3.1 (via pgtools binary suite, the compiling instructions have been pulled, heh) time ~/pgtools/pgtools check ~/Downloads/test.sql real 0m10.077s command: Checking, postgrestools.jsonc ok, so there we go. It's not super clear that INSERT introduced a connection, so maybe we could look at this as feedback issue -- if connection is attempted, and especially if fails, we ought to have feedbac. restoring the connection, I get: ✖ relation "foo" does not exist
✖ Error Code: 42P01 Ok, this makes sense, but it raises more questions; why does simple syntax checking write to the database? This is source level initialization script. |
That makes sense! Can you try to pass |
Yep, that definitely addresses the symptoms. I guess I would register two points of concern: #1: The default behavior of 'check', to execute DML is dangerous IMO. Particularly if psql directives are not honored.. the structure of this file was something like: I can understand referencing a database for things like column completion, but not in this context. This seems a bit dangerous IMO, (based on very superficial analysis); need to study this more. My gut says parser/checker use the database as a parse cache of various objects rather try and execute DML unless you very specifically tell it to do that. #2: As noted upthread, connection failure fails w/o output. From command line perspective, it ought to just fail? It might be perceived (as I did) as slow performance |
thanks for your feedback!
we do not execute anything. We are just
Fully agree here! We need to report that better. Will keep this issue open for that. |
Bug report
test.sql:
INSERT INTO foo DEFAULT VALUES ON CONFLICT DO NOTHING;
...is parsing, but takes ~ 10 seconds to parse. This is slow enough to be considered bug IMNSHO.
The text was updated successfully, but these errors were encountered: