Skip to content

feat: support externally managed sql.DB for postgres backend#9

Merged
ronething merged 2 commits intomasterfrom
feat/support_sqldb
Feb 27, 2026
Merged

feat: support externally managed sql.DB for postgres backend#9
ronething merged 2 commits intomasterfrom
feat/support_sqldb

Conversation

@ronething
Copy link

@ronething ronething commented Feb 25, 2026

  • Add support for initializing the Postgres backend with an externally managed *sql.DB.
  • Introduce generic.OpenWithDB(...) and pgsql.NewWithDB(...) to skip internal DB open/retry flows when a DB handle is already managed by the caller.
  • Extend endpoint config with an optional DB field and route backend initialization to the new path when provided.

Signed-off-by: Ashing Zheng <axingfly@gmail.com>
@ronething ronething changed the title feat: support external sqldb args feat: support externally managed sql.DB for postgres backend Feb 26, 2026
@ronething ronething marked this pull request as ready for review February 26, 2026 07:41
)

for i := 0; i < 300; i++ {
db, err = openAndTest(driverName, dataSourceName)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This err was ignored.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

Signed-off-by: Ashing Zheng <axingfly@gmail.com>
@ronething ronething merged commit 870e71d into master Feb 27, 2026
1 check passed
@ronething ronething deleted the feat/support_sqldb branch February 27, 2026 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants