prqlc/bindings/prqlc-c/README.md
This module compiles PRQL as a library (both .a and .so are generated). This
allows embedding in languages that support FFI — for example, Golang.
See examples/minimal-c/Makefile for the canonical link flags used to build the bundled C example.
To link against the static library from another build system, point the linker
at the directory containing libprqlc_c.a and add prqlc_c plus its system
dependencies, for example:
CGO_LDFLAGS="-L/path/to/target/release -lprqlc_c -pthread -ldl -lm" go build
(On macOS, also add -framework CoreFoundation.)
compile, custom Options, error handling, and the staged
prql_to_pl / pl_to_rq entry points.@cImport
against prqlc.h.The full FFI surface is documented inline in prqlc.h.
The C & C++ header files prqlc.h & prqlc.hpp were generated using
cbindgen. To generate a new one run:
task build-prqlc-c-header
...or copy & paste the commands from the Taskfile.