databricks / sqltools-databricks-driver

SQLTools driver for Databricks SQL
Other
11 stars 3 forks source link

Unable to run queries with parameters #36

Closed lenabradley closed 1 year ago

lenabradley commented 1 year ago

In databricks sql, I commonly use parameters (e.g. {{my_param}}, especially for queries that will power dashboards. These queries do not seem to work when run via this VSCode extension.

E.g. this query:

SELECT _id
FROM some_table
limit cast({{N}} as int);

works in DB SQL but when run from VSCode extension gives this error:

Something went wrong.
TypeError: messages.map is not a function

    in Unknown
    in div
    in ForwardRef
    in ForwardRef
    in Unknown
    in Unknown
    in div
    in Unknown
    in Unknown
    in Unknown
    in ErrorBoundary
    in ThemeProvider_ThemeProvider
    in Unknown
[Open VS Code DevTools](command:workbench.action.webview.openDeveloperTools)
superdupershant commented 1 year ago

Hi @lbartell! Currently that "parameters" feature is something that only works within the Redash UI in Databricks SQL. It's not a general feature of the SQL engine. That said we're working on some kind of first class SQL parameter support that works across all tools, it's just not ready yet.

fjakobs commented 1 year ago

Still we have to fix the error handling and not just crash.

fjakobs commented 1 year ago

Error handling should be fixed in #41

fjakobs commented 1 year ago

Screenshot 2022-12-21 at 09 55 35