Re: [go-nuts] SQL Interceptor

2018-09-10 Thread Free Ekanayaka
Conrad Wood writes: > On Mon, 2018-09-10 at 09:44 +0200, Jan Mercl wrote: >> >> On Mon, Sep 10, 2018 at 8:16 AM Conrad Wood >> wrote: >> >> > Wdyt? Is that a patch that would be acceptable and generally >> useful? >> >> It could be tried and evaluated first as an external package. >> >> -- 

Re: [go-nuts] SQL Interceptor

2018-09-10 Thread Conrad Wood
Sure point, I also have doubts about modifying the request on-the-fly. >From the point of "accessing an external system" it is similar and I'd even be in favour of a generic tracing/timing mechanism for *anything* that needs I/O or is otherwise subject to latency jitter. Perhaps widening the scope

Re: [go-nuts] SQL Interceptor

2018-09-10 Thread Tristan Colgate
It's worth considering that gRPC interceptors are not passive participants in gRPC requests. They can actively modify the requests, and responses (e.g. to enforce authentication). It's not obvious what that would look like for SQL, or if that is even desirable. There is a pre-existing db/sql issu

Re: [go-nuts] SQL Interceptor

2018-09-10 Thread Conrad Wood
On Mon, 2018-09-10 at 09:05 +0100, Tristan Colgate wrote: > There are two existing projects used to achieve similar goals: > > https://github.com/ExpansiveWorlds/instrumentedsql > https://github.com/gchaincl/sqlhooks > > native support could probably improve things a little, but this is a > very

Re: [go-nuts] SQL Interceptor

2018-09-10 Thread Tristan Colgate
There are two existing projects used to achieve similar goals: https://github.com/ExpansiveWorlds/instrumentedsql https://github.com/gchaincl/sqlhooks native support could probably improve things a little, but this is a very reasonable approach. On Mon, 10 Sep 2018 at 08:59 Conrad Wood wrote:

Re: [go-nuts] SQL Interceptor

2018-09-10 Thread Conrad Wood
On Mon, 2018-09-10 at 09:44 +0200, Jan Mercl wrote: > > On Mon, Sep 10, 2018 at 8:16 AM Conrad Wood > wrote: > > > Wdyt? Is that a patch that would be acceptable and generally > useful? > > It could be tried and evaluated first as an external package. > > --  > -j Not sure I understand. The p

Re: [go-nuts] SQL Interceptor

2018-09-10 Thread Jan Mercl
On Mon, Sep 10, 2018 at 8:16 AM Conrad Wood wrote: > Wdyt? Is that a patch that would be acceptable and generally useful? It could be tried and evaluated first as an external package. -- -j -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

[go-nuts] SQL Interceptor

2018-09-09 Thread Conrad Wood
Hi, I'm thinking of an addition to the sql package. I like to call an interceptor on each completed statement. I'm interested in timing information (prometheus in my case) and status codes. There may be other useful information, such as, number of rows (for "selects"), which we could make avail