Skip to content

refactor(fabric)!: remove unused SQL NewDriver wrappers and TracingConfig - #2058

Merged
mbrandenburger merged 1 commit into
hyperledger-labs:mainfrom
entrepreneurme:refactor/fabric-remove-unused-newdriver-wrappers
Oct 12, 2026
Merged

mbrandenburger merged 1 commit into
hyperledger-labs:mainfrom
entrepreneurme:refactor/fabric-remove-unused-newdriver-wrappers

Conversation

@entrepreneurme

@entrepreneurme entrepreneurme commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

What and why

The fabric SDK (platform/fabric/sdk/dig/sdk.go) builds its SQL persistence drivers with sqlite.NewNamedDriver and postgres.NewNamedDriver, which call NewDriverWithDbProvider. sqlite.NewDriver and postgres.NewDriver are one-line wrappers around NewDriverWithDbProvider with no callers in any FSC module. The fabric common.TracingConfig is an empty struct with no references; the SQL drivers use the view-package TracingConfig.

This PR removes the two wrappers, the postgres test that covered only the wrapper, and the fabric TracingConfig.

Fixes #2005

Breaking changes

These exported symbols are removed:

  • platform/fabric/services/db/driver/sql/sqlite.NewDriver
  • platform/fabric/services/db/driver/sql/postgres.NewDriver
  • platform/fabric/services/db/driver/sql/common.TracingConfig

Migration:

  • sqlite.NewDriver(cfg) → sqlite.NewDriverWithDbProvider(cfg, sqlite2.NewDbProvider()), with sqlite2 = platform/view/services/storage/driver/sql/sqlite
  • postgres.NewDriver(cfg) → postgres.NewDriverWithDbProvider(cfg, postgres2.NewDbProvider()), with postgres2 = platform/view/services/storage/driver/sql/postgres
  • fabric common.TracingConfig → platform/view/services/storage/driver/sql/common.TracingConfig

Panurus (main at 0dd0f85) does not import these packages, so it is not affected.

How it was verified

  • grep across all FSC modules finds no remaining use of the removed symbols.
  • go test ./platform/fabric/services/db/driver/sql/postgres -run 'TestNewDriverWithDbProvider|TestNewNamedDriver' passes.
  • go test ./platform/fabric/services/db/driver/sql/common/ passes.
  • go test ./platform/fabric/services/db/driver/sql/sqlite compiles the package, which has no tests.

Not changed

The view-package sqlite.NewDriver, postgres.NewDriver and TracingConfig, and the fabric memory.NewDriver, are separate symbols. They stay, and tests across fabric, fabricx and view call memory.NewDriver.

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Hey @entrepreneurme 👋 thanks for the PR!
I'm your friendly PR Helper Bot 🤖 and I'll be riding shotgun on this one, keeping track of your PR's status to help you get it approved and merged.

This comment updates automatically as you push changes -- think of it as your PR's live scoreboard!
Here's the latest:


PR Checks

✅ DCO Sign-off -- All commits have valid sign-offs. Nice work!


❌ GPG Signature -- Heads up! The following commits don't have a verified GPG signature:

  • 68f7e09 refactor(fabric)!: remove unused SQL NewDriver wrappers and TracingConfig

You'll need to sign your commits with GPG (e.g. git commit -S). See the Signing Guide for a step-by-step walkthrough.


✅ Merge Conflicts -- No merge conflicts detected. Smooth sailing!


✅ Issue Link -- Linked to #2005 (assigned to you).


⏳ All checks must pass before this PR can be reviewed. You've got this!

@github-actions github-actions Bot added the status: needs review The pull request is ready for maintainer review label Oct 12, 2026
@mbrandenburger mbrandenburger added this to the 26Q4 milestone Oct 12, 2026
@mbrandenburger
mbrandenburger self-requested a review October 12, 2026 12:18
@mbrandenburger
mbrandenburger enabled auto-merge (squash) October 12, 2026 12:37

@mbrandenburger mbrandenburger left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you @entrepreneurme for working on this!

@mergify

mergify Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

…nfig

Production wires the fabric SQL drivers through NewNamedDriver. The one-line NewDriver wrappers and the empty fabric TracingConfig were never used.

Signed-off-by: Ujjwal Khandelwal <ujjwal.khandelwal@yahoo.com>
@mbrandenburger
mbrandenburger force-pushed the refactor/fabric-remove-unused-newdriver-wrappers branch from bb37240 to 68f7e09 Compare October 12, 2026 12:38
@github-actions github-actions Bot added status: needs revision The pull request requires changes from the author before it can be reviewed or merged and removed status: needs review The pull request is ready for maintainer review labels Oct 12, 2026
@mbrandenburger
mbrandenburger merged commit 9c4d431 into hyperledger-labs:main Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: needs revision The pull request requires changes from the author before it can be reviewed or merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(fabric): remove the unused NewDriver wrappers and TracingConfig from the SQL DB drivers

2 participants