-
Notifications
You must be signed in to change notification settings - Fork 651
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
Better Error Messages #640
Comments
Really good idea. Do you know if there is a standardised SQL error list?
Do you have any inputs which ones to start with? |
I'm not sure there are any global standards for sql errors, but I would expect oracle to be a good choice. |
I would say definitely, start with the basics, ones that happen with incorrect syntax, or missing something important. |
The parenthesis is tricky as its part of the parser generated from JISON Now - I got the most common errors with error in table name and error in column name > alasql('create table abc (a int)')
1
> alasql('select a from abc')
[]
> alasql('select b from abc')
Uncaught Error: Column does not exists: b
> alasql('select a from abcd')
Uncaught Error: Table does not exists: abcd Please try it out in the last version of https://github.com/agershun/alasql/blob/develop/dist/alasql.js |
Perfect, although I am unsure whether it was caused by this update, but it seems that it is now required to wrap any columns with ``.
Is this intentional? Version: v0.2.5-develop-1262 |
Hmm, what sql are you using. I cant replicate it: // alasql.version: 0.2.5-develop-1262
> alasql('create table abc (a int)')
1
> alasql('insert into abc values(2), (5)')
2
> alasql('column of select a from abc')
[2, 5]
> alasql('column of select b from abc')
Uncaught Error: Column does not exists: b |
Strange... I wonder what was causing it. Ignore then ;) |
Could I suggest error messages be similar to sql, for example:
If a column you are querying does not exist, you would error log:
Unknown column 'columnname' in 'tablename' or Column 'columnname' doesn't exist in 'tablename'
Also, a lot of errors are not being handled and return javascript errors, perhaps we should go through some common errors we know of and then add better error logging to them.
The text was updated successfully, but these errors were encountered: