I am new to Supabase and seeing an error while att...
# help
e
I am new to Supabase and seeing an error while attempting to use the SQL editor to run a command to define some new tables and relations: I can see the error but there is no line number associated with it. Is there a way to get this information?
s
Can you provide some more information about the error please and also example of the code you are running?
e
Are you unable to reproduce this UI when your sql config code contains an error or otherwise cannot run successfully?
My question is about why there is no associated line number with any and all errors, not about about a specific error
@User My question is why error lines aren't being printed in the SQL Editor. Your question seems to imply that it's possible that some errors will print error lines and some will not. If that's the case could you point me to a reproducible example of the behavior of error line numbers being printed or share a test suite which documents the expected behavior? Thanks!
s
I don't think most SQL editors even outside of the Supabase SQL editor UI tells you the line number the error is on. SQL errors are generally like this in my experience. But I think this one is telling you exactly what the issue is and is easy enough to find in this example (line 6 is where the issue is at as I'm guessing you have run this query already). Please provide full code example next time as it's easier to help that way.
e
I found this SQL validator for free online and it includes a line number with the error as an example. Manually spotting errors is highly suboptimal with non-toy configurations: https://www.eversql.com/sql-syntax-check-validator/
I think your answer matches what I recall to be true about five years ago but I don't think that's an accurate characterization today. Totally understand if your feature priority roadmap doesn't include this right now but it seems fairly trivial to implement.
s
Your example says there is an error in that code, but none of the other SQL editors (TablePlus, Beekeeper Studio and the Supabase Query Editor) I have used to run that code complained and just ran the code without any issues
I think the Supabase Query Editor shows line number when the error is appropriate enough to show it, but I think in the case above its complaining about something specific that doesn't have a line number involved
e
There's definitely a distinction between a simple linter and being able to connect to an application context
Would it be possible to get the call context to display?
s
I just did another test and it seems each editor has a different behaviour but there should be a way to detect the line number, its probably best to raise a feature request for this to be implemented (I'm not sure the amount of effort it will require, but at least getting it on the radar would be good)
e
sounds good, thanks! It's not a major hiccup, I'm just trying to be a champion for Supabase in my organization and there's some skepticism
s
In TablePlus
e
Something like PG_EXCEPTION_CONTEXT, perhaps
s
While in Beekeeper Studio
e
This is useful info, thanks!
In this case it's not a greenfield bakeoff so much as "firebase isn't meeting our needs but maybe that's just life"
anyway, really appreciate your time
s
Thanks for this @User, it would be really good if we can get this implemented as it helps with the developer experience on the platform, especially when it comes to dealing with SQL errors.