diff options
author | zvrh <16538800+zvrh@users.noreply.github.com> | 2022-01-05 22:02:33 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-05 22:02:33 +0800 |
commit | a9be4de5a568b15384e1dec11f008d844c8e9c05 (patch) | |
tree | a055445dc0a497d8a8fc62eaebf81969a7bab8b3 /internal/db/db_test.go | |
parent | 14481533b829b2c85465abedace2736423c767ae (diff) |
database: add PostgreSQL custom schema support (#6695)
Co-authored-by: Homura37 <git@gvip.xyz>
Co-authored-by: Homura <16538800+Homura37@users.noreply.github.com>
Co-authored-by: Joe Chen <jc@unknwon.io>
Diffstat (limited to 'internal/db/db_test.go')
-rw-r--r-- | internal/db/db_test.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/db/db_test.go b/internal/db/db_test.go index 8c894125..e16c9486 100644 --- a/internal/db/db_test.go +++ b/internal/db/db_test.go @@ -96,11 +96,12 @@ func Test_parseDSN(t *testing.T) { Type: "postgres", Host: "/tmp/pg.sock", Name: "gogs", + Schema: "test", User: "gogs@local", Password: "pa$$word", SSLMode: "disable", }, - expDSN: "postgres://gogs%40local:pa%24%24word@:5432/gogs?sslmode=disable&host=/tmp/pg.sock", + expDSN: "user='gogs@local' password='pa$$word' host='/tmp/pg.sock' port='5432' dbname='gogs' sslmode='disable' search_path='test'", }, { name: "postgres: tcp", @@ -108,11 +109,12 @@ func Test_parseDSN(t *testing.T) { Type: "postgres", Host: "127.0.0.1", Name: "gogs", + Schema: "test", User: "gogs@local", Password: "pa$$word", SSLMode: "disable", }, - expDSN: "postgres://gogs%40local:pa%24%24word@127.0.0.1:5432/gogs?sslmode=disable", + expDSN: "user='gogs@local' password='pa$$word' host='127.0.0.1' port='5432' dbname='gogs' sslmode='disable' search_path='test'", }, { |