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

This library doesnt work with sql.Conn #140

Closed
masterkidan opened this issue Apr 20, 2022 · 2 comments
Closed

This library doesnt work with sql.Conn #140

masterkidan opened this issue Apr 20, 2022 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@masterkidan
Copy link
Contributor

masterkidan commented Apr 20, 2022

Describe the bug
A clear and concise description of what the bug is.

Environment (please complete the following information):

  • OS: all
  • Database: all
  • Database driver: N/A
  • Jet version v2.7.1

Code snippet
Query statement and model files of interest.

The library doesn't work with sql.Conn as mentioned in the Readme sections. The issue is that qrm.DB expects the driver to implement both methods with context and without context, however sql.Conn only implements QueryContext, ExecContext etc.
This makes this library difficult to use with Connection Pooling
Expected behavior
Update qrm.DB interface to only require methods with Context, that should allow it to work with sql.DB and sql.Conn.

@masterkidan masterkidan added the bug Something isn't working label Apr 20, 2022
@go-jet
Copy link
Owner

go-jet commented Apr 21, 2022

Hi @masterkidan. I think we could create two new interfaces Queryable(for QueryContext) and Executable(for ExecContext), which would be passed as a parameter instead of qrm.DB. qrm.DB is already part of public API, so we can't remove methods from it. But we can mark it as deprecated.

@go-jet go-jet added this to the Version 2.8.0 milestone Apr 21, 2022
@go-jet go-jet mentioned this issue May 17, 2022
@go-jet
Copy link
Owner

go-jet commented May 17, 2022

Fixed with Release 2.8.0.

@go-jet go-jet closed this as completed May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants