Skip to content
This repository was archived by the owner on Jul 21, 2025. It is now read-only.

Commit 4c55d4e

Browse files
committed
iter: expose columns
1 parent cafebae commit 4c55d4e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

query.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,9 @@ func (q *Query) Iter(ctx context.Context) Iter {
309309
errCh: make(chan error, 1),
310310
}
311311

312+
if q.stmt.Metadata != nil {
313+
it.result.ColSpec = q.stmt.Metadata.Columns
314+
}
312315
info, err := q.info()
313316
if err != nil {
314317
it.errCh <- err
@@ -350,6 +353,10 @@ var (
350353
ErrNoMoreRows = fmt.Errorf("no more rows left")
351354
)
352355

356+
func (it *Iter) Columns() []frame.ColumnSpec {
357+
return it.result.ColSpec
358+
}
359+
353360
func (it *Iter) PageState() []byte {
354361
return it.result.PagingState
355362
}

0 commit comments

Comments
 (0)