alexbrainman / odbc

odbc driver written in go
BSD 3-Clause "New" or "Revised" License
352 stars 140 forks source link

Implement driver.ExecerContext #137

Open john8329 opened 5 years ago

john8329 commented 5 years ago

Hi, it seems that the driver doesn't implement the driver.ExecerContext interface. The Execer one is going to be deprecated soon. Apparently there is no way to cancel a request, as it is now.

alexbrainman commented 5 years ago

Hi, it seems that the driver doesn't implement the driver.ExecerContext interface.

It does not.

The Execer one is going to be deprecated soon.

What do you mean deprecated soon? How soon? Do you have references?

Apparently there is no way to cancel a request, as it is now.

True.

I don't need this feature. I am not planing to implement it.

Feel free to change it yourself. I will be happy to answer any questions, and review you change, if you like.

Thank you.

Alex

john8329 commented 5 years ago

// Exec executes a query that doesn't return rows, such

// as an INSERT or UPDATE.

//

// Deprecated: Drivers should implement StmtExecContext instead (or additionally).

Exec(args []Value) (Result, error)


From the driver.go standard interface. How soon? Ask the Go folks. I need some deep knowledge of how ODBC works for this, and It needs time. That's why I use a library. If this becomes a critical feat, I'd be happy to try implementing it.

alexbrainman commented 5 years ago
```go

// Exec executes a query that doesn't return rows, such

// as an INSERT or UPDATE.

//

// Deprecated: Drivers should implement StmtExecContext instead (or additionally).

Exec(args []Value) (Result, error)


From the driver.go standard interface.

Thanks for the reference. This just says don't use Exec, if you could use StmtExecContext. But we could not use StmtExecContext, so we will use Exec for now.

How soon? Ask the Go folks.

Will do.

I need some deep knowledge of how ODBC works for this, and It needs time. That's why I use a library. If this becomes a critical feat, I'd be happy to try implementing it.

Same. I don't have spare time to spend on this. So, if you really need it, just have a go.

And I am not ODBC expert myself, I needed to access data in my MS SQL Server, so I built this.

Alex

john8329 commented 5 years ago

Please explore the driver.go file, you'll find that every call that doesn't use context.Context{} is deprecated. I'm too no expert, and used it for FileMaker, I guess we're on the same line then.

ninthclowd commented 3 years ago

I've decided to take a stab at this and have submitted pull request #151 to add context support