feat: Snowflake adapter - #109
Conversation
2f4e993 to
be8c26f
Compare
be8c26f to
d0bef59
Compare
| 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.
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.
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. |
|
+1 this would be useful! |
- Implement comprehensive Snowflake database adapter - Support for password, keypair (JWT), and MFA/SSO authentication methods - Private key loading with PKCS1/PKCS8 format support and encryption - Cost-optimized queries using SHOW statements to avoid warehouse wake-up - Database operations: structure browsing, column metadata, database switching - Complete unit test suite with authentication method validation - Documentation with setup guide and troubleshooting - Environment variable template support for secure credential management Addresses: kndndrj#23, builds on kndndrj#109 and kndndrj#186
Closes #23
Implemented a Snowflake adapter using gosnowflake.
Steps followed
go get -u github.com/snowflakedb/gosnowflake@latestThis 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)