ploomber / jupysql

Better SQL in Jupyter. 📊
https://jupysql.ploomber.io
Apache License 2.0
661 stars 72 forks source link

Issue on page /api/magic-tables-columns.html #1014

Open dominijk opened 3 weeks ago

dominijk commented 3 weeks ago

Is it possible to use sqlcmd with an alias? I've attempted this as below

%sqlcmd one tables

and get

UsageError: %sqlcmd has no command: 'one'. Valid commands are: tables, columns, test, profile, explore, snippets, connect

What's the equivalent of showing tables for a specific alias?

edublancas commented 3 weeks ago

you're getting that error because the first argument to %sqlcmd must be a valid command. if you want to show tables you can do %sqlcmd tables, this will show the tables in the default schema, if you want a different schema, you can do %sqlcmd tables --schema schemaname does this help?

dominijk commented 3 weeks ago

I think the answer is no, i had set an alias as

%sql sqlite:///one.db --alias one

but then wanted to get the table of the alias using

%sqlcmd tables but as my error %sqlcmd doesn't have that command

edublancas commented 3 weeks ago

ok got it. you meant a connection alias

you're right, currently we don't support that. I'll keep this issue open

It should be an easy fix; contributions are welcome!