Skip to content
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

Added support for snowflake database #11

Closed
wants to merge 2 commits into from

Conversation

williamszostak-lm
Copy link

Hello grafana team,

In my work for Liberty Mutual Insurance, I needed to do some database load testing, and I found that k6, together with xk6-sql, was a powerful and flexible tool that enabled me to quickly and easily run the types of load tests that I needed to do.

One of the database platforms that I needed to test was snowflake. xk6-sql didn't support snowflake, but there is an open source go module for snowflake at: github.com/snowflakedb/gosnowflake. By looking at the code for xk6-sql, I found it was very easy to add a dependency to gosnowflake, and with just a few simple changes, I had a working version that was able to run tests against my snowflake database!

Thank you for providing this great open-source code, and for organizing the code so clearly, so that it was easy for a newbie to add support for another database platform!

This pull request has the changes that I made to enable support for snowflake. If you'd like to merge this in to your project, to allow others to use snowflake as well, I'd be honored. Or if there's some other process I should follow to propose changes and/or submit code, please let me know.

If you're not interested in supporting snowflake as a database, or simply don't consider pull requests from random outsiders, I understand. Please feel free to use the code if you find it helpful, or ignore this PR otherwise.

Thank you, and best wishes to the grafana team!

@imiric
Copy link
Contributor

imiric commented Mar 4, 2022

Hi William, thank you for contributing this! Some of us on the team weren't familiar with Snowflake, but it seems like a very popular cloud database.

Unfortunately, we can't merge this into the project for a few reasons:

  • gosnowflake has the AWS SDK as a dependency, which is a large amount of code to support overall. The k6 binary built with xk6-sql is currently 27MB, but with this extension it jumps up to 34MB, which is a big difference. Not only the binary size, but the amount of code we'd have to eventually support if something goes wrong is a lot for our current resources.

  • Snowflake is a commercial DBaaS which is very different from the open-source RDBMSs xk6-sql currently supports. This means that testing it would be particularly difficult as we'd need to have an account for testing, which might be paid or not, I'm not entirely sure. In any case this would be more difficult than the current workflow of starting a local Docker container to test against.

  • The goal of this extension isn't to support every SQL dialect out there, but to support the most popular ones in general use. While Snowflake is popular in the corporate setting, it's not widely used in smaller environments.

That said, you can always keep using your fork as a separate extension (xk6-snowflake?), and use that internally instead of xk6-sql. If you do decide to rename it and maintain it publicly, I encourage you to submit a PR to k6-docs with a change to this file so that it can appear on our list of extensions and more people could use it.

Thanks again, and good luck!

@imiric imiric closed this Mar 4, 2022
@williamszostak-lm
Copy link
Author

Thanks, Ivan! Makes sense, and I appreciate you're taking a look at it.
Best wishes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants