MCPcopy Create free account
hub / github.com/dolthub/doltgresql / Next

Method Next

testing/go/regression/tool/message_reader.go:48–65  ·  view source on GitHub ↗

Next returns the next message, or nil if the reader has been exhausted.

()

Source from the content-addressed store, hash-verified

46
47// Next returns the next message, or nil if the reader has been exhausted.
48func (mr *MessageReader) Next() pgproto3.Message {
49 if len(mr.queue) > 0 {
50 if len(mr.queue) == 1 {
51 m := mr.queue[0]
52 mr.queue = nil
53 return m
54 } else {
55 m := mr.queue[0]
56 mr.queue = mr.queue[1:]
57 return m
58 }
59 }
60 if mr.idx >= len(mr.messages) {
61 return nil
62 }
63 mr.idx++
64 return mr.messages[mr.idx-1]
65}
66
67// Peek returns the next message without moving the reader forward, or nil if the reader has been exhausted.
68func (mr *MessageReader) Peek() pgproto3.Message {

Callers 9

SyncToNextQueryMethod · 0.95
ReplayFunction · 0.95
TestIssue2386Function · 0.45
ReadRowsFunction · 0.45
TestMultipleStatementsFunction · 0.45
drainIterFunction · 0.45
allDatabaseNamesMethod · 0.45
QueryMethod · 0.45

Calls

no outgoing calls

Tested by 6

TestIssue2386Function · 0.36
TestMultipleStatementsFunction · 0.36
drainIterFunction · 0.36
allDatabaseNamesMethod · 0.36
QueryMethod · 0.36