I don't think ops in context is how I would clean room design this, but it
is the better of many other options.

The tx begin is easier, but still difficult when I need to ensure drivers
can set custom attributes. The problem with something like you suggested is
it deviates too far from the original API.

If you have a concrete proposal, file an issue cc me in the next day or
two. At the least tx begin needs a way for drivers to set custom
attributes.

On Sun, Dec 11, 2016, 06:48 Gulácsi Tamás <tgulacs...@gmail.com> wrote:

> 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