File size: 415 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package swoinfo

import (
	"context"
	"sort"

	"github.com/jackc/pgx/v5"
	"github.com/target/goalert/swo/swodb"
)

// ScanSequences will return the names of all sequences in the database, ordered
// by name.
func ScanSequences(ctx context.Context, conn *pgx.Conn) ([]string, error) {
	names, err := swodb.New(conn).SequenceNames(ctx)
	if err != nil {
		return nil, err
	}

	sort.Strings(names)
	return names, nil
}