refactor(query_builder): consolidate query builders with Strategy pattern#311
Merged
kcenon merged 2 commits intoJan 2, 2026
Merged
Conversation
…tern Implement Strategy pattern to unify 4 separate query builder classes into a single query_builder with interchangeable dialect strategies. Changes: - Add query_dialect interface with sql_dialect, mongodb_dialect, redis_dialect - Refactor query_builder to use single dialect instead of 3 builders - Add [[deprecated]] attributes to sql_query_builder, mongodb_query_builder, and redis_query_builder classes - Reduce memory footprint by ~66% (1 allocation vs 3) - Maintain backward compatibility with legacy update(data) and insert(data) APIs Closes #310
- Add query_builder Strategy pattern changes to CHANGELOG - Update query_builder API documentation with new methods - Mark sql_query_builder, mongodb_query_builder, redis_query_builder as deprecated - Document memory efficiency improvements (~66% reduction) Related: #310
Contributor
Benchmark ResultsNo comparison reports available. Baseline may not be established yet. |
kcenon
added a commit
that referenced
this pull request
Apr 13, 2026
…tern (#311) * refactor(query_builder): consolidate query builders with Strategy pattern Implement Strategy pattern to unify 4 separate query builder classes into a single query_builder with interchangeable dialect strategies. Changes: - Add query_dialect interface with sql_dialect, mongodb_dialect, redis_dialect - Refactor query_builder to use single dialect instead of 3 builders - Add [[deprecated]] attributes to sql_query_builder, mongodb_query_builder, and redis_query_builder classes - Reduce memory footprint by ~66% (1 allocation vs 3) - Maintain backward compatibility with legacy update(data) and insert(data) APIs Closes #310 * docs: update API reference and changelog for Strategy pattern refactor - Add query_builder Strategy pattern changes to CHANGELOG - Update query_builder API documentation with new methods - Mark sql_query_builder, mongodb_query_builder, redis_query_builder as deprecated - Document memory efficiency improvements (~66% reduction) Related: #310
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
query_dialectinterface withsql_dialect,mongodb_dialect,redis_dialectimplementationsquery_builderto use single dialect instead of 3 separate buildersChanges
New Files
database/query_dialect.h- Strategy interface and dialect implementationsdatabase/query_dialect.cpp- Implementation of dialect strategiesModified Files
database/query_builder.h- Extended API, deprecated individual buildersdatabase/query_builder.cpp- Refactored to use single dialectdatabase/CMakeLists.txt- Added new source filesdocs/CHANGELOG.md- Documented changesdocs/API_REFERENCE.md- Updated API documentationTest plan
universal_query_builder_test: 21 tests PASSEDsql_query_builder_test: 41 tests PASSEDmongodb_query_builder_test: 35 tests PASSEDredis_query_builder_test: 37 tests PASSEDAcceptance Criteria
query_builderclass as primary APICloses #310