Back to Prql

PRQL C library

prqlc/bindings/prqlc-c/README.md

0.13.131.3 KB
Original Source

PRQL C library

Description

This module compiles PRQL as a library (both .a and .so are generated). This allows embedding in languages that support FFI — for example, Golang.

Linking

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.)

Examples

The full FFI surface is documented inline in prqlc.h.

Development

Headers

The C & C++ header files prqlc.h & prqlc.hpp were generated using cbindgen. To generate a new one run:

sh
task build-prqlc-c-header

...or copy & paste the commands from the Taskfile.