Skip to content

Commit 8a391c4

Browse files
committed
fix(questdb/test): Assert NextRow values are non-empty
1 parent b4a2c68 commit 8a391c4

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

internal/impl/questdb/integration_test.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,17 @@ output:
6666
defer pgConn.Close(ctx)
6767

6868
result := pgConn.ExecParams(ctx, fmt.Sprintf("SELECT content, id FROM '%v' WHERE id=%v", testID, messageID), nil, nil, nil, nil)
69+
defer result.Close()
70+
71+
if !result.NextRow() {
72+
return "", nil, fmt.Errorf("no row found for messageID %v", messageID)
73+
}
74+
75+
values := result.Values()
76+
if len(values) < 2 {
77+
return "", nil, fmt.Errorf("expected 2 columns, got %d", len(values))
78+
}
6979

70-
result.NextRow()
7180
id, err := strconv.Atoi(string(result.Values()[1]))
7281
assert.NoError(t, err)
7382
data := map[string]any{

0 commit comments

Comments
 (0)