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

Method IterateSequences

core/sequences/collection.go:259–272  ·  view source on GitHub ↗

IterateSequences iterates over all sequences in the collection.

(ctx context.Context, f func(seq *Sequence) (stop bool, err error))

Source from the content-addressed store, hash-verified

257
258// IterateSequences iterates over all sequences in the collection.
259func (pgs *Collection) IterateSequences(ctx context.Context, f func(seq *Sequence) (stop bool, err error)) (err error) {
260 // For now, this function isn't used in a critical path, so we're not too worried about performance
261 if err = pgs.cacheAllSequences(ctx); err != nil {
262 return err
263 }
264 for _, seq := range pgs.accessedMap {
265 if stop, err := f(seq); err != nil {
266 return err
267 } else if stop {
268 break
269 }
270 }
271 return nil
272}
273
274// NextVal returns the next value in the sequence.
275func (pgs *Collection) NextVal(ctx context.Context, name id.Sequence) (int64, error) {

Callers 3

IterAllMethod · 0.95
DebugStringMethod · 0.80
RowIterMethod · 0.80

Calls 1

cacheAllSequencesMethod · 0.95

Tested by

no test coverage detected