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
bigquery: Support math/big.Int as parameter type #4703
Comments
I'll need to look at this. The issue is we try to determine the bigquery type from the go type. Clearly we need to consider another mechanism for the user to explicitly provide the destination BQ type. |
@shollyman maybe this should be another issue, but I would also be happy to provide/receive the value as a string as send to/returned by BigQuery (as I assume underneath it's all HTTP anyway, right?). I know it doesn't really fit the current API, but could that be a (future) possibility? |
@Thomasdezeeuw recently we merged some work to add support for explicit typed query parameters. Although right now you can't pass a
Do you think this solves your issue ? |
@alvarowolfx yes that works. We just switched to that API for #4704, I forgot to mention it here. I'm ok with closing this issue. |
Awesome, thanks for the feedback @Thomasdezeeuw and I'm gonna close this. |
I'm using QueryParameter to send parameters along with my query. On the BigQuery side I'm using
BIGNUMERIC(32)
(no precision, i.e. an integer) as type. Normally you would useint64
as type, however my input doesn't fit in 64 bits. I tried usingbig.Rat
but BigQuery doesn't allow silent truncation (and rightfully so).Go has nice package for large numbers:
math/big
, which is already partially support throughbig.Rat
. Howeverbig.Int
doesn't seem to be supported. Is it possible for this client to supportbig.Int
? I'm will to give it a go if it's an acceptable change (and someone can point into the right direction w.r.t. the code).The text was updated successfully, but these errors were encountered: