Polypheny C++ Driver

The Polypheny C++ Driver uses the Prism protocol to run SQL and MongoQL, execute prepared statements and batches, and read entity metadata. The driver also decodes graph frames from servers that send them. The default build of driver v1.0.0 uses the released Prism 2.2 definitions. It connects to servers that report compatibility with Prism 2.x. Document collection metadata requires server support introduced in Prism 2.2.

Build from a release

Install a C++17 compiler, Meson 1.0 or newer, Ninja, pkg-config, GMP with its C++ interface, OpenSSL, and the Protobuf compiler and C++ library from the same installation. On Debian-based distributions the corresponding packages are g++, meson, ninja-build, pkg-config, libgmp-dev, libssl-dev, protobuf-compiler and libprotobuf-dev.

Download the versioned release archive and its SHA-256 file to the same directory. The archive includes the pinned Prism schemas and Catch2 3 sources. On Linux, verify the download and build it with the bundled dependencies.

sha256sum -c Polypheny-CPP-Driver-1.0.0.tar.gz.sha256
tar -xzf Polypheny-CPP-Driver-1.0.0.tar.gz
cd Polypheny-CPP-Driver-1.0.0
meson setup build --wrap-mode=nodownload
meson compile -C build
meson test -C build --print-errorlogs

The default tests run without a Polypheny server. The build also compiles the driver repository’s examples in build/examples.

Use the driver in a Meson application

Extract the release archive into your application’s subprojects directory so that subprojects/Polypheny-CPP-Driver-1.0.0/meson.build exists. Save the integration example as main.cpp in your application’s root. In the same directory, create the following meson.build file.

project('polypheny-example', 'cpp', default_options : ['cpp_std=c++17'])

driver = subproject('Polypheny-CPP-Driver-1.0.0')
driver_dep = driver.get_variable('polypheny_cpp_driver_dep')
executable('polypheny-example', 'main.cpp', dependencies : driver_dep)

Build from the application root and start the executable with the Prism server running.

meson setup build
meson compile -C build
./build/polypheny-example

The dependency supplies the include paths for PolyphenyCPPDriver.h and the linked driver and system libraries.

Experimental streaming build

Applications targeting the experimental Prism 5.1 protocol can use a separate build directory. Use a compatible experimental server for live streaming. See connection compatibility and streaming in the API reference.

meson setup build-streaming -Dprism_streaming=true --wrap-mode=nodownload
meson compile -C build-streaming
meson test -C build-streaming --print-errorlogs

Acknowledgments

Tobias Hafner developed the initial driver as part of his master’s project at the University of Basel. Tobias Hafner

© Polypheny GmbH. All Rights Reserved.