MCPcopy
hub / github.com/jackc/pgx / TestConnQueryContextSuccess

Function TestConnQueryContextSuccess

stdlib/sql_test.go:835–847  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

833}
834
835func TestConnQueryContextSuccess(t *testing.T) {
836 testWithAllQueryExecModes(t, func(t *testing.T, db *sql.DB) {
837 rows, err := db.QueryContext(context.Background(), "select * from generate_series(1,10) n")
838 require.NoError(t, err)
839
840 for rows.Next() {
841 var n int64
842 err := rows.Scan(&n)
843 require.NoError(t, err)
844 }
845 require.NoError(t, rows.Err())
846 })
847}
848
849func TestRowsColumnTypeDatabaseTypeName(t *testing.T) {
850 testWithAllQueryExecModes(t, func(t *testing.T, db *sql.DB) {

Callers

nothing calls this directly

Calls 5

NextMethod · 0.65
ScanMethod · 0.65
ErrMethod · 0.65
QueryContextMethod · 0.45

Tested by

no test coverage detected