Skip to content

refactor(config): dedup query config inner/outer#19446

Merged
dantengsky merged 4 commits intodatabendlabs:mainfrom
dantengsky:refactor/config
Feb 11, 2026
Merged

refactor(config): dedup query config inner/outer#19446
dantengsky merged 4 commits intodatabendlabs:mainfrom
dantengsky:refactor/config

Conversation

@dantengsky
Copy link
Member

@dantengsky dantengsky commented Feb 11, 2026

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

  • Deduplicate query config by embedding outer::QueryConfig into inner::QueryConfig.common
  • Preserve existing env override semantics by keeping the outer config flat (no nested common layer)
  • Keep runtime-only fields scoped in inner config (tenant_id, node_id, node_secret, builtin/settings), and access configurable fields explicitly via query.common.*

Design Choice

  • We intentionally avoid Deref/DerefMut from inner config to outer config.
  • Deref is idiomatic mainly for pointer-like wrappers; using it here would blur domain boundaries between runtime-only and user-configurable fields.
  • Explicit query.common.* access keeps field ownership and data source clear, improves readability/grep-ability, and makes future refactors safer.
  • Avoiding DerefMut also prevents implicit mutable access paths that are easy to misuse in a large codebase.

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@github-actions github-actions bot added the pr-refactor this PR changes the code base without new features or bugfix label Feb 11, 2026
@dantengsky dantengsky merged commit 0d0fe02 into databendlabs:main Feb 11, 2026
89 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-refactor this PR changes the code base without new features or bugfix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants