2.2 KiB
2.2 KiB
AGENTS.md
pgLab: Qt 6 / C++20 desktop GUI for PostgreSQL.
Layout (link order: core, pgsql -> pglablib -> pglab)
core/– generic utilities (SQL lexer, CSV writer,Expected, JSON); no DB access.pgsql/– thin C++ wrapper around libpq (connection, result, params, oids).pglablib/– catalog models, code builders, query generation, connection config.pglab/– the Qt Widgets application (executable).tests/– gtest executablesPgsqlTestsandpglabtests, plusmygtestutils(QtPrintTohelpers).docs/– Sphinx user docs;releasenotes/notes–renonotes.
Build and test
CMake + vcpkg is the active build system (VCPKG_ROOT must be set). Qt 6 is not provided by vcpkg; it must be installed on the system.
cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake
cmake --build build
ctest --test-dir build --output-on-failure
- Run one suite:
./build/tests/pglabtests/pglabtests --gtest_filter='SqlLexer*'(same forPgsqlTests). -DBUILD_TESTS=OFFskips tests.build/is git-ignored; the first configure builds dependencies and is slow.- Run the app headless with
QT_QPA_PLATFORM=offscreen ./build/pglab/pglab. It needs a PostgreSQL server for anything useful.
Gotchas
- Tests are registered per executable, so each
ctestentry covers a whole suite. - A new test file must be added to the
add_executablelist intests/<suite>/CMakeLists.txt. Sources are listed explicitly, with no globbing. The same goes for new sources in each library'sCMakeLists.txt. core/test/is not referenced by any CMake file (its tests are built fromtests/pglabtests). Don't expect changes there to be compiled.AUTOMOC/AUTOUIC/AUTORCCare on globally, so.uiand.qrcfiles only need to be listed as sources.BOOST_ENABLE_ASSERT_HANDLERis defined; the handler lives incore/my_boost_assert_handler.cpp.- Commit messages are plain imperative sentences. User-visible changes need a reno note (
releasenotes/notes). - Docs build:
pip install -r docs/requirements.txt && sphinx-build -b html docs userdocs. - Windows (VS 2022) is also a supported platform. Avoid Linux-only code, and don't break
WIN32_LEAN_AND_MEAN/NOMINMAXassumptions.