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

Commit abaf0c9

Browse files
committed
query: add NoSkipMetadata
1 parent 115704a commit abaf0c9

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

query.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,11 @@ func (q *Query) SerialConsistency(v frame.Consistency) frame.Consistency {
223223
return q.stmt.SerialConsistency
224224
}
225225

226+
func (q *Query) NoSkipMetadata() *Query {
227+
q.stmt.NoSkipMetadata = true
228+
return q
229+
}
230+
226231
type Result transport.QueryResult
227232

228233
func (q *Query) Iter(ctx context.Context) Iter {

transport/query.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ type Statement struct {
1717
SerialConsistency frame.Consistency
1818
Tracing bool
1919
Compression bool
20+
NoSkipMetadata bool
2021
Idempotent bool
2122
Metadata *frame.ResultMetadata
2223
}
@@ -48,7 +49,7 @@ func makeQuery(s Statement, pagingState frame.Bytes) Query {
4849
}
4950

5051
func makeExecute(s Statement, pagingState frame.Bytes) Execute {
51-
return Execute{
52+
res := Execute{
5253
ID: s.ID,
5354
Consistency: s.Consistency,
5455
Options: frame.QueryOptions{
@@ -59,6 +60,11 @@ func makeExecute(s Statement, pagingState frame.Bytes) Execute {
5960
PageSize: s.PageSize,
6061
},
6162
}
63+
if s.NoSkipMetadata {
64+
res.Options.Flags &= ^frame.SkipMetadata
65+
}
66+
67+
return res
6268
}
6369

6470
func makeStatement(cql string) Statement {

0 commit comments

Comments
 (0)