#21 allows to overwrite postgres connection

This commit is contained in:
Alex Senger 2024-04-19 17:11:10 +02:00
parent c372167032
commit 1e621394d5
No known key found for this signature in database
GPG key ID: 0B4A96F8AF6934CF

View file

@ -26,6 +26,13 @@ func WithMaxInterval(maxInterval time.Duration) Option {
} }
} }
// WithConnection overwrites the default sql.DB
func WithConnection(connection *sql.DB) Option {
return func(c *Checkpoint) {
c.conn = connection
}
}
// Checkpoint stores and retrieves the last evaluated key from a DDB scan // Checkpoint stores and retrieves the last evaluated key from a DDB scan
type Checkpoint struct { type Checkpoint struct {
appName string appName string