Good question.
QueryContext(ctx context.Context, query QueryWithOpts, args ...interface{})
(sql.Rows, error)
?

Where
type QueryWithOpts struct {
    fmt.Stringer
    opts []qryOpt
}

and

func Query(qry string, options ...qryOpt) QueryWithOpts

á'lá sql.NamedArg.


But this feels just as hacky, as putting those options into the context...

Daniel Theophanes <kardia...@gmail.com> ezt írta (időpont: 2016. dec. 11.,
V, 14:48):

> How would you put them in query when args are the last ...warm?
>
> On Sat, Dec 10, 2016, 22:44 Tamás Gulácsi <tgulacs...@gmail.com> wrote:
>
> I'd also like to change the API for passing options as Andrè suggested: by
> optional funcs. But everywhere - they're not to be in a Context!
>
> To put them in Context feels a hack.
>
>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "golang-nuts" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/golang-nuts/20NtIGTgBeg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to