#786·pq

Context support

Author: GeertJohanCreated Sep 7, 2018Updated Aug 16, 2026
Labelsenhancement

I'd like for pq to support the *Context calls.

In one of my projects I started using github.com/basvanbeek/ocsql. It wraps the driver and adds OpenCensus tracing. This works great, even when wrapping the sql.DB with sqlx for extra functionality. However, it requires the driver to support Context calls as defined in the stdlib (BeginTx, ExecContext, etc.). Therefore, I (temporarily?) switched to [github.com/jackc/pgx/stdlib](https://godoc.org/github.com/jackc/pgx/stdlib

I think that pg should support these functions. https://golang.org/pkg/database/sql/driver