| assets/logo | ||
| backup | ||
| book | ||
| cmake | ||
| contribution | ||
| include/querycpp | ||
| integration_test | ||
| scripts | ||
| test | ||
| versions | ||
| .clang-format | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| CHANGELOG.md | ||
| CMakeLists.txt | ||
| docker-compose.yml | ||
| Dockerfile | ||
| Doxyfile | ||
| LICENSE | ||
| querycpp.pc.in | ||
| README.md | ||
QueryC++ (?++) is a modern C++ library for build SQL queries directly in C++ code with the goal of removing raw SQL strings in code.
Building and Installation
Whilst QueryC++ is a header only library. We do provided a way to install it using CMake. Furthermore we also use CMake to build our unit and integration tests.
To install queryc++ follow these steps:
mkdir build
cd build
cmake ..
make
sudo make install
The make install must be done with sudo on most systems.
Mac issue and script solution
Some see issues on macOS due to how macOS setup the system.
For people using clang installed using homebrew
To solve this we have the build_mac.sh script in the scripts folder.
You can add any CMake options needed after the. so sh scripts/build_mac.sh <OPTION>.
It can take 0 or more arguments.
Build and run unit tests
We do not build the unit tests by default.
To do this you will need to add -DBUILD_TEST=1 to your CMake command
To run all unit tests run make test after the make command that builds the tests.
Build with integration tests
We do not build the unit tests by default.
To do this you will need to add BUILD_INTEGRATION_TEST=1 to your CMake command
Currently we have integration tests for:
- sqlite
- PostgreSQL
Each integration test gets a sub folder, see below, that contains a integration test binary. You can use these to run the integration test
integration_test
├── postgres
│ └── pqqxx_integration_test
└── sqlite
└── sqlite_integration_test
Export compile commands
Add -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
