Comments (3)
Thanks for the quick response. It seems that binding variable works for other types. For example:
ctx, _ := gosnowflake.WithMultiStatement(context.Background(), 2)
rows, _ := c.QueryContext(ctx, "SELECT CASE WHEN TO_BOOLEAN(?) THEN 1 ELSE 2 END; SELECT 0", strconv.FormatBool(true))
from gosnowflake.
Hello - thank you for raising this issue! Snowflake (the backend, not the driver) currently does not support binding variables in multiple statement queries. Documentation: https://docs.snowflake.com/en/developer-guide/sql-api/submitting-multiple-statements
we're working on adding this bit to each driver's own documentation. edit until then, as a workaround, please submit the variable bound statements as an individual one - tested and it works perfectly with
selectQuery := "SELECT CASE WHEN ? THEN 1 ELSE 2 END"
rows, err := conn.QueryContext(ctx, selectQuery, true)
(and of course sf.WithMultiStatement
either set to 1
or context not created as a multi-statement)
from gosnowflake.
that's a great find and happy that it works; unclear if it's intended to work or unexpected because the current documented behaviour is it should not work. so maybe proper care should be taken when considering taking dependency on this behaviour.
from gosnowflake.
Related Issues (20)
- Array binding support for filtering parameter HOT 2
- SNOW-938672 Snyk: gosnowflake google.golang.org/grpc v1.49.0 | Snyk ID - SNYK-GOLANG-GOOGLEGOLANGORGGRPC-5953328 HOT 3
- Segfault from s3_storage_client.go:96 HOT 6
- WithMultiStatement - creates an extra process for all queries that doesn't resolve until all queries are resolved. Takes up extra space and blocks other requests. HOT 2
- SNOW-995607 Snyk: gosnowflake golang.org/x/crypto v0.15.0 | Snyk ID - SNYK-GOLANG-GOLANGORGXCRYPTOSSH-6130669 HOT 3
- SNOW-995714 SNOW-998050 Calling stored procedure returning a table in multi-statements query fail with code = 100132 HOT 2
- SNOW-996366 Snyk: gosnowflake github.com/dvsekhvalnov/jose2go 1.5.0 | Snyk ID - SNYK-GOLANG-GITHUBCOMDVSEKHVALNOVJOSE2GO-6137739 HOT 4
- Context not propagated to snowflakeFileTransferAgent on PUT command; cancellation is not supported HOT 3
- JWT token generation is generating an invalid JWT issuer using {account} value HOT 4
- SNOW-1011471 Authentication failed when setting search_path parameter on connection string HOT 3
- GetArrowBatches panics when query returns 0 rows HOT 8
- SNOW-1017575 github.com/form3tech-oss/jwt-go is deprecated HOT 3
- No way to add a row with different typed columns through gosnowflake driver HOT 2
- SNOW-1020361 Unable to insert a UUID/byte array into an existing table HOT 7
- SNOW-1045439 Timestamp_ntz column values are formatted with UTC timezone HOT 3
- SNOW-1061246 "account" parameter is always required by `sf.DSN`? HOT 3
- Race in `easy_logging.go` introduced in v1.8.0 HOT 1
- Expecting OBJECT but got VARCHAR when inserting a JSON value. HOT 3
- #993 Causes ambiguous error to be thrown when result is nil HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gosnowflake.