Thank you for considering contributing to SQLQueryBuilder! This modern C++ library aims to provide a type-safe, efficient SQL query builder with minimal heap allocations. We value your input and want to ensure your contributions align with the project's design philosophy.
- Getting Started
- Coding Conventions
- Development Environment
- Testing Guidelines
- Submitting Contributions
- Code of Conduct
-
Fork the Repository
Begin by forking this repository and cloning your fork locally. -
Create a Branch
Use a descriptive branch name following the formatfeature/descriptionorfix/issue-description. -
Stay Up-to-Date
Regularly pull changes from the main branch to avoid merge conflicts.
SQLQueryBuilder follows modern C++ best practices with a focus on performance and type safety:
- Use C++17/20 features including concepts,
std::string_view, andstd::span - Maintain a zero-heap allocation philosophy where possible
- Follow naming conventions aligned with Google C++ Style Guide:
camelCasefor methods and variablessnake_casewith trailing underscores for private members (name_)PascalCasefor class names
- Apply C++ Core Guidelines for:
- Strong typing
- Const correctness
- Use the
[[nodiscard]]attribute for methods that produce values meant to be used
- String handling guidelines:
- Prefer
std::string_viewfor non-owning references following abseil's string_view guide - Use
std::stringwhen string ownership is required for persistence - Be extremely careful about string ownership when constructing complex conditions
- Prefer
- Use the
inline namespace v1pattern for API versioning - Document all public APIs with Doxygen-style comments
- Include examples for complex functionality
- Compiler: Use a modern C++ compiler supporting C++17 or later
- GCC 9+
- Clang 10+
- MSVC 2019+ with
/std:c++17or higher
- Build System: CMake 3.14 or newer
- Optional Dependencies:
- Qt 5.15+ or Qt 6.x for Qt integration features
- Catch2 for testing
Configure your environment with:
mkdir build && cd build
cmake .. -DBUILD_TESTING=ON
cmake --build .- Write Unit Tests: All new features should include corresponding unit tests using Catch2
- Test Template Instantiations: Ensure your tests cover various template instantiations
- Performance Testing: Include benchmarks for performance-critical code paths
- String Ownership: Add specific tests verifying correct string ownership management
- Test All Placeholder Styles: Ensure all placeholder types work correctly
Run tests with:
cd build
ctest -V-
Open an Issue First
Discuss significant changes before implementation to ensure alignment with project goals. -
Make Atomic Commits
Each commit should represent a single logical change with a clear message. -
Pull Request Process
- Reference any related issues
- Include a detailed description of changes
- Ensure all tests pass
- Verify code follows all conventions
-
Code Review
Be responsive to feedback and be prepared to make requested changes.
We expect all contributors to be respectful and collaborative. Harassment or disrespectful behavior will not be tolerated. We aim to foster an inclusive community where everyone feels welcome to contribute.
Thank you for contributing to SQLQueryBuilder! If you have questions, please open a discussion or contact the maintainers directly.