From 7577a39dd96c65dd4c485f2cc0cb1d40a84db9be Mon Sep 17 00:00:00 2001 From: eelke Date: Sun, 18 Oct 2026 07:45:03 +0200 Subject: [PATCH] Add IDE files --- .idea/.gitignore | 10 ++ .idea/editor.xml | 367 ++++++++++++++++++++++++++++++++++++++++++++ .idea/encodings.xml | 4 + .idea/modules.xml | 8 + .idea/pgLab.iml | 8 + .idea/vcs.xml | 6 + AGENTS.md | 32 ++++ 7 files changed, 435 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/editor.xml create mode 100644 .idea/encodings.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/pgLab.iml create mode 100644 .idea/vcs.xml create mode 100644 AGENTS.md diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..30cf57e --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,10 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Ignored default folder with query files +/queries/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/editor.xml b/.idea/editor.xml new file mode 100644 index 0000000..a3aeb4c --- /dev/null +++ b/.idea/editor.xml @@ -0,0 +1,367 @@ + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..df87cf9 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..498ae80 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/pgLab.iml b/.idea/pgLab.iml new file mode 100644 index 0000000..6102194 --- /dev/null +++ b/.idea/pgLab.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..b9c08b0 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,32 @@ +# 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 executables `PgsqlTests` and `pglabtests`, plus `mygtestutils` (Qt `PrintTo` helpers). +- `docs/` – Sphinx user docs; `releasenotes/notes` – `reno` notes. + +## 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 for `PgsqlTests`). +- `-DBUILD_TESTS=OFF` skips 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 `ctest` entry covers a whole suite. +- A new test file must be added to the `add_executable` list in `tests//CMakeLists.txt`. Sources are listed explicitly, with no globbing. The same goes for new sources in each library's `CMakeLists.txt`. +- `core/test/` is not referenced by any CMake file (its tests are built from `tests/pglabtests`). Don't expect changes there to be compiled. +- `AUTOMOC`/`AUTOUIC`/`AUTORCC` are on globally, so `.ui` and `.qrc` files only need to be listed as sources. +- `BOOST_ENABLE_ASSERT_HANDLER` is defined; the handler lives in `core/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`/`NOMINMAX` assumptions.