-
Notifications
You must be signed in to change notification settings - Fork 130
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
Feature request: Mock, Fake, or Dev Docker image #279
Comments
Did you find any solution to this? I'm looking for the same, but for node :) |
depending on how complex your queries are you could use a Postgres for MySQL container in Dev to mock out snowflake. |
When inserting large amounts of data, the `snowflake_put` output should outperform `sql_insert` because it uses Snowpipe directly. However, the Snowflake SQL driver also attempts to send the data to a temporary stage when the number of messages in a batch exceeds an [undocumented](https://pkg.go.dev/github.com/snowflakedb/gosnowflake#hdr-Batch_Inserts_and_Binding_Parameters) threshold, but it's not very consistent. Details [here](snowflakedb/gosnowflake#540). This implementation should satisfy the basic use cases, but it might be possible to optimise inserts later by binding array variables to parameters. Details [here](https://pkg.go.dev/github.com/snowflakedb/gosnowflake#hdr-Binding_Parameters_to_Array_Variables). Unfortunately, I was unable to add integration tests based on MySQL as described [here](snowflakedb/gosnowflake#279) because [this code](https://github.com/snowflakedb/gosnowflake/blob/74e351e5e110c5b4c409730b47d5fa4058ab1c6f/auth.go#L45-L91) does not allow me to set the `authenticator` parameter to `tokenaccessor`, so I can't get the driver to bypass the authentication step. There might be other blockers too, not sure.
I attempted to get this driver to connect to a MySQL Docker container, but, unfortunately, it doesn't work. Since this code doesn't allow the |
thank you for raising this request with us; we'll take a look if and how it would be feasible to provide. can not estimate any timeline though, so thank you for bearing with us ! |
Hello everyone! Snowflake is a cloud platform, can't be installed on premise. It was build natively for the cloud. It consists of many components internally and making it available in a docker image would be extremely difficult. On the other hand, preparing mock is some idea, but has a huge drawback - it should be kept up-to-date with the Snowflake cloud, so we are not planing to do it. We are planning to do some mocking, but only to cover corner cases, especially errors, that may be difficult to trigger from tests - so it doesn't answer your request too. The closest thing to what you need is that we are planning to split tests into slow and fast ones (you can call it real unit tests and integration tests using Snowflake or stages). Still, even if we had this, it would test only less relevant cases. Not sure when this will happen though. One last suggestion here - if your concern is not "offline mode", but not using production Snowflake for tests, you can always use trial. It is a bit inconvenient, because it is time limited, but it is better than nothing. |
Thank you for the update! I still think this would be a valuable utility to provide in the future, even if it will be very limited in capabilities. Let me share some concrete examples:
These are quite limited in terms of features, but that's just fine for a small The alternative is for developers to add a layer of indirection in their code which wraps the relevant parts of At the very least, consider making it easy for the community to build and maintain such containers, similar to https://github.com/goccy/bigquery-emulator, by having a mechanism to bypass Snowflake authentication and provide a custom endpoint. |
hi all - after discussing this internally again, i'm going to close this issue as it has nothing to do with As mentioned by my colleague before, as a workaround today for any tests which require Snowflake, the trial accounts can be used. We can still see how this would be valuable to implement but it definitely should not come from the driver side; as it is only another consumer for Snowflake. Therefore if you are already a Snowflake customer and having a 'mock' Snowflake backend available to you would be important, please do reach out to your Account Team to let them know about your requirement. |
Guys, this comment may be very helpful. I haven't tried it myself, but looks very promising. Kudos to Stathi for bringing it to our attention! |
I would like to be able to run tests while offline, or in a CI environment that is offline.
I would also like to be able to develop locally on my laptop while offline.
For most other data stores, I am able to use a docker image in development and test/ci environments. It isn't fast, but it doesn't need to be fast.
Does Snowflake have anything like this?
And if not, can it please be considered?
The text was updated successfully, but these errors were encountered: