-
I am creating a end-to-end test with multiple SQL statements within a single SQL notebook and we'd like to switch database connections between certain SQL queries. For example: USE DATABASE myconn_name; --is something like this allowed?
SELECT * FROM TABLE;
SELECT * FROM TABLE;
SELECT * FROM TABLE; |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Right now there isn't a way to achieve this. Switching active connections requires invocation in the sidebar. It sounds like you're trying to use a SQL notebook for an end-to-end testing framework. I don't think it'll be possible for us to make SQL Notebook remain minimal and simple while also serving both the interactive prototyping and automated end-to-end testing use cases. At present, we perform a very minimal parsing of the actual SQL file, only for separating cells. Your proposal would require parsing the SQL into a AST, handling various different dialects, etc. I don't think this is worth the trade off. |
Beta Was this translation helpful? Give feedback.
Right now there isn't a way to achieve this. Switching active connections requires invocation in the sidebar.
It sounds like you're trying to use a SQL notebook for an end-to-end testing framework. I don't think it'll be possible for us to make SQL Notebook remain minimal and simple while also serving both the interactive prototyping and automated end-to-end testing use cases. At present, we perform a very minimal parsing of the actual SQL file, only for separating cells. Your proposal would require parsing the SQL into a AST, handling various different dialects, etc. I don't think this is worth the trade off.