-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Snowflake adapter #109
base: master
Are you sure you want to change the base?
Conversation
2f4e993
to
be8c26f
Compare
be8c26f
to
d0bef59
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, I'm not a maintainer but I have some suggestion to improve it (maybe). It involves the use of SHOW instead of SELECTS to avoid waking up warehouses
SELECT column_name, data_type | ||
FROM information_schema.columns | ||
WHERE | ||
table_schema=UPPER('%s') AND | ||
table_name=UPPER('%s') | ||
ORDER BY ordinal_position |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is better to use SHOW as command
to avoid warehouse costs https://docs.snowflake.com/en/sql-reference/sql/show-columns
SELECT | ||
table_schema AS schema_name | ||
, table_name | ||
, CASE | ||
WHEN table_type = 'BASE TABLE' THEN 'TABLE' | ||
ELSE table_type | ||
END AS table_type | ||
FROM | ||
information_schema.tables | ||
WHERE | ||
table_schema NOT IN ('INFORMATION_SCHEMA', 'PG_CATALOG') | ||
AND table_catalog = CURRENT_DATABASE(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SHOW TABLE can do that https://docs.snowflake.com/en/sql-reference/sql/show-tables
Bumping this. What would it take to get this merged? |
Re bumping it, as a data engineer I would love to be able to use snowflake inside neovim :) |
Totally agree with this! |
Hey @oliverlambson! The plugin has been stale for some time, but we have actively started doing work again. Then we would be happy to review this PR. |
@phdah i actually don't use snowflake anymore (and don't even have access to a warehouse since leaving my previous job) perhaps @AM-I-Human, @Slanman3755, @ArthurMynl or @SergioQuijanoRey would like to pick it up? |
I've actually also been working on my own fork that's rebased on top of master and trying to get I'd be willing to try and help this get across the line if needed. |
Closes #23
Implemented a Snowflake adapter using gosnowflake.
Steps followed
go get -u github.com/snowflakedb/gosnowflake@latest
This changed a lot of go.mod and I have no idea if that's expected behaviour (I assumed it would only add required deps, but it seems to have bumped a bunch of versions too. I'm not a go dev, sorry)
I did this by building the binary (
go build
) and replacing the default binary that the nvim-dbee lua config points to (in my case at/Users/oliverlambson/.local/share/nvim/dbee/bin/dbee
, I'm on an M1 Mac)Manual testing
(sorry had to redact everything because I don't have a dummy snowflake to play with)