You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TSQL select queries can take conditions in a where clause:
$ delphin select'i-id where readings > 0 or i-input ~"dog"'
Some operators (>, >=, <, <=) expect numeric values, others expect strings (~, !~), and some work for both (=, !=). Currently if a user uses an incorrect type, a TSQLSyntaxError is raised that explains the problem:
$ delphin select'i-id where i-id ~ 1' mrs/Traceback (most recent call last):[...]delphin.tsql.TSQLSyntaxError: line 1 1TSQLSyntaxError: expected one of: a double-quoted string, a single-quoted string
While the error message could be improved, it is reasonable. But if the query is syntactically valid but the query's data type doesn't match that of the column in the database, a more cryptic error message is raised:
$ delphin select'i-id where i-date ~"jan"' mrs/Traceback (most recent call last):[...]TypeError: expected string or bytes-like object
These errors would be easy to check before executing the query. We could also allow string and regex matches to work on the string form of the value, regardless of the column's datatype, but this wouldn't help with numeric comparisons on string columns.
The text was updated successfully, but these errors were encountered:
TSQL
select
queries can take conditions in awhere
clause:$ delphin select 'i-id where readings > 0 or i-input ~ "dog"'
Some operators (
>
,>=
,<
,<=
) expect numeric values, others expect strings (~
,!~
), and some work for both (=
,!=
). Currently if a user uses an incorrect type, aTSQLSyntaxError
is raised that explains the problem:While the error message could be improved, it is reasonable. But if the query is syntactically valid but the query's data type doesn't match that of the column in the database, a more cryptic error message is raised:
These errors would be easy to check before executing the query. We could also allow string and regex matches to work on the string form of the value, regardless of the column's datatype, but this wouldn't help with numeric comparisons on string columns.
The text was updated successfully, but these errors were encountered: