Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add readme on query prefix #180

Merged
merged 2 commits into from
Dec 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,23 +224,37 @@ 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
Now to build the extension, run:
Checkout git submodules:
```sh
make
git submodule update --init --recursive
```
The main binaries that will be built are:
Now to build the extension, run:
```sh
./build/release/duckdb
./build/release/test/unittest
./build/release/extension/duckpgq/duckpgq.duckdb_extension
make <debug> GEN=ninja
```
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.

## Running the extension
To run the extension code, simply start the shell with `./build/release/duckdb`.

> [!CAUTION]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

> 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
Expand Down
Loading