]> source.dussan.org Git - gitea.git/commit
Ensure that schema search path is set with every connection on postgres (#14131)
authorzeripath <art27@cantab.net>
Sat, 2 Jan 2021 02:07:43 +0000 (02:07 +0000)
committerGitHub <noreply@github.com>
Sat, 2 Jan 2021 02:07:43 +0000 (10:07 +0800)
commitac88b0ee839bfbfae5759e211d0f9a69abe4d8f7
tree9859ba50be23e00926eb973b77074ba5c1c7de7e
parentd44f192d3e584489de560485f871d3600f75a1cd
Ensure that schema search path is set with every connection on postgres (#14131)

* Ensure that schema search path is set with every connection on postgres

Unfortunately every connection to postgres requires that the search path is
set appropriately.

This PR shadows the postgres driver to ensure that as soon as a connection
is open, the search_path is set appropriately.

Fix #14088

Signed-off-by: Andrew Thornton <art27@cantab.net>
* no golangci-lint that is not a helpful suggestion

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Use Execer if available

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
models/models.go
models/sql_postgres_with_schema.go [new file with mode: 0644]