diff options
author | Runxi Yu <me@runxiyu.org> | 2025-04-05 23:33:20 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-04-05 23:33:20 +0800 |
commit | b29061d0798ad854cd0f27ce60d7c58c10a239e9 (patch) | |
tree | b1892db8fe9b49cba1a6a48227144e0863257ae1 /server.go | |
parent | Move trivial template functions into misc (diff) | |
download | forge-b29061d0798ad854cd0f27ce60d7c58c10a239e9.tar.gz forge-b29061d0798ad854cd0f27ce60d7c58c10a239e9.tar.zst forge-b29061d0798ad854cd0f27ce60d7c58c10a239e9.zip |
database: Separate opening the database into its own package
Diffstat (limited to 'server.go')
-rw-r--r-- | server.go | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -15,7 +15,7 @@ import ( "syscall" "time" - "github.com/jackc/pgx/v5/pgxpool" + "go.lindenii.runxiyu.org/forge/internal/database" "go.lindenii.runxiyu.org/lindenii-common/cmap" goSSH "golang.org/x/crypto/ssh" ) @@ -23,10 +23,7 @@ import ( type Server struct { config Config - // database serves as the primary database handle for this entire application. - // Transactions or single reads may be used from it. A [pgxpool.Pool] is - // necessary to safely use pgx concurrently; pgx.Conn, etc. are insufficient. - database *pgxpool.Pool + database database.Database sourceHandler http.Handler staticHandler http.Handler |