FAQ
Hello,
When scanning result of select query with joins, some rows may contain
duplicated data.
Here is a simple example to illustrate the problem:
http://play.golang.org/p/ca0MiPU_dO
To make partial scan (to scan only some columns), the example uses a dummy
variable (lines 49, 51, 65).
Could it be possible to make the Scan method accept "nil" value to say "I
don't want to retrieve this value" ?
Or do you have any other solution to avoid using "dummy" variables just to
make Scan method work ?

Thanks.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Carlos Castillo at May 26, 2013 at 7:38 pm
    Why are you calling rows.Scan multiple times for a single row? Couldn't you
    just read all the fields in the first call, and then either use, or not use
    some of them depending on your code?

    You look to be attempting to micro-optimize, but the only work you'd
    theoretically save would be a potential conversion to float64 (8 bytes).
    On Sunday, May 26, 2013 3:40:02 AM UTC-7, gwenn...@gmail.com wrote:

    Hello,
    When scanning result of select query with joins, some rows may contain
    duplicated data.
    Here is a simple example to illustrate the problem:
    http://play.golang.org/p/ca0MiPU_dO
    To make partial scan (to scan only some columns), the example uses a dummy
    variable (lines 49, 51, 65).
    Could it be possible to make the Scan method accept "nil" value to say "I
    don't want to retrieve this value" ?
    Or do you have any other solution to avoid using "dummy" variables just to
    make Scan method work ?

    Thanks.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedMay 26, '13 at 10:40a
activeMay 26, '13 at 7:38p
posts2
users2
websitegolang.org

2 users in discussion

Gwenn Kahz: 1 post Carlos Castillo: 1 post

People

Translate

site design / logo © 2021 Grokbase