From 1e621394d5721d2e0f445adf211e4781a1eff385 Mon Sep 17 00:00:00 2001 From: Alex Senger Date: Fri, 19 Apr 2024 17:11:10 +0200 Subject: [PATCH] #21 allows to overwrite postgres connection --- store/postgres/postgres.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/store/postgres/postgres.go b/store/postgres/postgres.go index 70c41b9..909e09d 100644 --- a/store/postgres/postgres.go +++ b/store/postgres/postgres.go @@ -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 type Checkpoint struct { appName string