gaum icon indicating copy to clipboard operation
gaum copied to clipboard

QueryPrimitive/FetchIntoPrimitive don't work with Returning

Open chipaca opened this issue 4 years ago • 0 comments

An Insert...Returning query that returns a single value that works with, say

var x []struct { X bool }
query.Returning("true AS x").Fetch(ctx, &x)

fails to run as

var x []bool
query.Returning("true AS x").FetchIntoPrimitive(ctx, &x)

(“querying for primitives can be done for 1 column only, got 0”, says the error)

chipaca avatar Sep 23 '21 15:09 chipaca