From d4766429cfa7cd9d6dc5e62fac0d02ece5e93a7a Mon Sep 17 00:00:00 2001 From: nkanaev Date: Sat, 13 Jun 2026 14:53:26 +0100 Subject: [PATCH] accept postgres url in New --- src/storage/storage.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/storage/storage.go b/src/storage/storage.go index b8a890c..47bef6b 100644 --- a/src/storage/storage.go +++ b/src/storage/storage.go @@ -1,7 +1,10 @@ package storage import ( + "strings" + "github.com/nkanaev/yarr/src/storage/model" + "github.com/nkanaev/yarr/src/storage/postgres" "github.com/nkanaev/yarr/src/storage/sqlite" ) @@ -32,5 +35,8 @@ type Storage interface { } func New(path string) (Storage, error) { + if strings.HasPrefix(path, "postgres://") || strings.HasPrefix(path, "postgresql://") { + return postgres.New(path) + } return sqlite.New(path) }