[PR #58] [MERGED] feat: enhance database initialization with fallback connection strategy #286

Closed
opened 2026-02-16 01:15:23 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langgenius/dify-plugin-daemon/pull/58
Author: @Yeuoly
Created: 3/5/2025
Status: Merged
Merged: 3/6/2025
Merged by: @Yeuoly

Base: mainHead: optimize/db-init


📝 Commits (1)

  • d6c6128 feat: enhance database initialization with fallback connection strategy

📊 Changes

4 files changed (+44 additions, -39 deletions)

View changed files

📝 internal/db/init.go (+35 -32)
📝 internal/db/pg_test.go (+1 -1)
📝 internal/types/app/config.go (+7 -6)
📝 internal/types/app/default.go (+1 -0)

📄 Description

  • Add support for connecting to a default database when target database connection fails
  • Introduce new configuration parameter DBDefaultDatabase with default value "postgres"
  • Modify initDifyPluginDB to attempt connection to default database and create target database if needed
  • Update test case to include default database parameter

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langgenius/dify-plugin-daemon/pull/58 **Author:** [@Yeuoly](https://github.com/Yeuoly) **Created:** 3/5/2025 **Status:** ✅ Merged **Merged:** 3/6/2025 **Merged by:** [@Yeuoly](https://github.com/Yeuoly) **Base:** `main` ← **Head:** `optimize/db-init` --- ### 📝 Commits (1) - [`d6c6128`](https://github.com/langgenius/dify-plugin-daemon/commit/d6c61289498294d7914d03c1c30b767ad23aad00) feat: enhance database initialization with fallback connection strategy ### 📊 Changes **4 files changed** (+44 additions, -39 deletions) <details> <summary>View changed files</summary> 📝 `internal/db/init.go` (+35 -32) 📝 `internal/db/pg_test.go` (+1 -1) 📝 `internal/types/app/config.go` (+7 -6) 📝 `internal/types/app/default.go` (+1 -0) </details> ### 📄 Description - Add support for connecting to a default database when target database connection fails - Introduce new configuration parameter `DBDefaultDatabase` with default value "postgres" - Modify `initDifyPluginDB` to attempt connection to default database and create target database if needed - Update test case to include default database parameter --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 01:15:23 -05:00
yindo closed this issue 2026-02-16 01:15:23 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-plugin-daemon#286