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
I encountered an edge case when validating the passed argument to%sql:
running rollback; or commit; should be interpreted as SQL commands (it works if I remove the ;). I think if the argument in %sql ends in ; we can be confident that this is SQL code and we should not validate it.
In [1]: %load_ext sql
Found pyproject.toml from '/Users/eduardo/Desktop/test-jupysql-dev-dsn-file'
In [2]: %sql duckdb://
In [3]: %sql rollback;
UsageError: 'rollback;' is not a valid connection identifier. Please pass the variable's name directly, as passing object attributes, dictionaries or lists won't work.
If you need help solving this issue, send us a message: https://ploomber.io/community
In [4]: %sql commit;
UsageError: 'commit;' is not a valid connection identifier. Please pass the variable's name directly, as passing object attributes, dictionaries or lists won't work.
If you need help solving this issue, send us a message: https://ploomber.io/community
In [5]: %sql commit
Running query in 'duckdb://'
Out[5]:
+---------+
| Success |
+---------+
+---------+
In [6]: %sql rollback
Running query in 'duckdb://'
Out[6]:
+---------+
| Success |
+---------+
+---------+
The text was updated successfully, but these errors were encountered:
I encountered an edge case when validating the passed argument to
%sql
:running
rollback;
orcommit;
should be interpreted as SQL commands (it works if I remove the;
). I think if the argument in%sql
ends in;
we can be confident that this is SQL code and we should not validate it.The text was updated successfully, but these errors were encountered: