From e3a8f71e908ef44d584f65d1c6e484ed2c4884f0 Mon Sep 17 00:00:00 2001 From: dentiny Date: Mon, 16 Dec 2024 09:47:35 +0000 Subject: [PATCH 1/2] Add readme on query prefix --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 854ee98f..e4382390 100644 --- a/README.md +++ b/README.md @@ -224,9 +224,13 @@ export VCPKG_TOOLCHAIN_PATH=`pwd`/vcpkg/scripts/buildsystems/vcpkg.cmake Note: VCPKG is only required for extensions that want to rely on it for dependency management. If you want to develop an extension without dependencies, or want to do your own dependency management, just skip this step. Note that the example extension uses VCPKG to build with a dependency for instructive purposes, so when skipping this step the build may not work without removing the dependency. ### Build steps +Checkout git submodules: +```sh +git submodule update --init --recursive +``` Now to build the extension, run: ```sh -make +make GEN=ninja ``` The main binaries that will be built are: ```sh @@ -241,6 +245,9 @@ The main binaries that will be built are: ## Running the extension To run the extension code, simply start the shell with `./build/release/duckdb`. +> [!CAUTION] +> Any query containing SQL/PGQ syntax requires a `-` at the start of the query when building the extension from the source, otherwise, you will experience a segmentation fault. This is not the case when loading the extension from DuckDB. + ## Running the tests Different tests can be created for DuckDB extensions. The primary way of testing DuckDB extensions should be the SQL tests in `./test/sql`. These SQL tests can be run using: ```sh From bb823f8094e62370ae2968645d93625bb31887af Mon Sep 17 00:00:00 2001 From: dtenwolde Date: Mon, 16 Dec 2024 11:20:13 +0100 Subject: [PATCH 2/2] Extend info on debug and release builds --- README.md | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e4382390..b0d387e5 100644 --- a/README.md +++ b/README.md @@ -232,12 +232,19 @@ Now to build the extension, run: ```sh make GEN=ninja ``` -The main binaries that will be built are: -```sh -./build/release/duckdb -./build/release/test/unittest -./build/release/extension/duckpgq/duckpgq.duckdb_extension -``` +The location of the binaries depends on the `BUILD_TYPE` flag (`release` or `debug`) specified during the build process. By default, the binaries are organized as follows: + +### For a **release build** (`make release`): +- DuckDB binary: `./build/release/duckdb` +- Unit tests: `./build/release/test/unittest` +- DuckPGQ extension: `./build/release/extension/duckpgq/duckpgq.duckdb_extension` + +### For a **debug build** (`make debug`): +- DuckDB binary: `./build/debug/duckdb` +- Unit tests: `./build/debug/test/unittest` +- DuckPGQ extension: `./build/debug/extension/duckpgq/duckpgq.duckdb_extension` + +Ensure you specify the appropriate `BUILD_TYPE` flag when configuring the build to place binaries in the corresponding directory. - `duckdb` is the binary for the duckdb shell with the extension code automatically loaded. - `unittest` is the test runner of duckdb. Again, the extension is already linked into the binary. - `duckpgq.duckdb_extension` is the loadable binary as it would be distributed. @@ -246,7 +253,7 @@ The main binaries that will be built are: To run the extension code, simply start the shell with `./build/release/duckdb`. > [!CAUTION] -> Any query containing SQL/PGQ syntax requires a `-` at the start of the query when building the extension from the source, otherwise, you will experience a segmentation fault. This is not the case when loading the extension from DuckDB. +> Any query containing SQL/PGQ syntax requires a `-` at the start of the query when building the extension from the source, otherwise, you will experience a segmentation fault. This is not the case when loading the extension from DuckDB. ## Running the tests Different tests can be created for DuckDB extensions. The primary way of testing DuckDB extensions should be the SQL tests in `./test/sql`. These SQL tests can be run using: