Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stmt should implement driver.StmtExecContext and driver.StmtQueryContext #732

Open
cespare opened this issue Mar 20, 2018 · 4 comments
Open

Comments

@cespare
Copy link

cespare commented Mar 20, 2018

This is a follow-on to #535.

For the driver.Stmt interface, the Exec and Query methods are deprecated. Drivers should instead (or additionally) implement ExecContext and QueryContext.

I couldn't find an existing issue or pull request regarding this. Apologies if I missed it.

/cc @mjibson

@maddyblue
Copy link
Collaborator

See #729. We will start by removing support for Go < 1.8, then we should be able to fully remove the deprecated methods and types.

@cespare
Copy link
Author

cespare commented Mar 20, 2018

Just to be clear, the problem here is that stmt doesn't implement the new methods, not that it does implement the deprecated methods.

@cespare
Copy link
Author

cespare commented Mar 20, 2018

Just to note the reason I ran into this: I have some code which needs to make use of a driver.Stmt directly and it calls stmt.Exec and stmt.Query. That triggers the deprecation checks in staticcheck (https://staticcheck.io/docs/staticcheck). I can't change my code to call stmt.ExecContext and stmt.QueryContext because pq.stmt doesn't implement those yet.

(It's not a big deal because I can filter out these warnings if I need to.)

@kylejbrock
Copy link
Contributor

@cespare & @mjibson Not sure if this helps, but here's this: #768

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants