xo / usql

Universal command-line interface for SQL databases
MIT License
8.82k stars 346 forks source link

awsathena driver does not support `\d` #375

Open forbesmyester opened 1 year ago

forbesmyester commented 1 year ago

I can connect to Athena using:

$ usql 's3://__S3_STAGING_DIR_NOT_URL_ENCODE_WITH_TRAILING_FORWARDSLASH_ALSO_NOT_ENCODED?WGRemoteCreation=true&accessID=__THE_ACCESS_KEY__&db=__DATABASE_NAME_PROBABLY_URLENCODED_&missingAsEmptyString=true&region=eu-west-2&secretAccessKey=__THE_SECRET_URLENCODED__'

Which does work / can query

However \d does not (not supported by awsathena driver).

s3:__S3_STAGING_DIR_NOT_URL_ENCODE_WITH_TRAILING_FORWARDSLASH_ALSO_NOT_ENCODED=> \d
error: describe commands not supported by awsathena driver
$ usql --version
usql 0.12.13
nineinchnick commented 1 year ago

I haven't used Athena but it's using Presto/Trino so I hope it's enough to plug in the default informationschema metadata reader, like we do for Trino: https://github.com/xo/usql/blob/master/drivers/trino/trino.go#L58

forbesmyester commented 1 year ago

I can confirm it does have an information schema... I am unsure if the format conforms to Presto or anything else though.