Pure C examples for the IoTDB Session C API (SessionC.h): tree model (tree_example) and table model (table_example). Default connection: 127.0.0.1:6667, user root / password root (edit the macros at the top of each .c file).
Using Maven to build this example project (requires Boost, same as the C++ client; on Windows see iotdb-client/client-cpp/README.md):
cd the root path of the whole projectmvn package -DskipTests -P with-cpp -pl example/client-c-example -ammvn clean package ... when no other process holds files under iotdb-client/client-cpp/target; on Windows add Boost paths, e.g.-D"boost.include.dir=C:\local\boost_1_87_0" -D"boost.library.dir=C:\local\boost_1_87_0\lib64-msvc-14.2")cd example/client-c-example/targetAfter a successful build you should have:
client/ and Thrift under thrift/ (same layout as client-cpp-example)Release/tree_example.exe, Release/table_example.exeStart IoTDB first, then:
# Windows (example) Release\tree_example.exe Release\table_example.exe
On failure, the programs print to stderr and you can inspect ts_get_last_error().
example/client-c-example/ +-- README.md +-- pom.xml +-- src/ | +-- CMakeLists.txt | +-- tree_example.c | +-- table_example.c
The Maven build copies src/*.c and src/CMakeLists.txt into target/ next to the unpacked client/ and thrift/ trees, then runs CMake to compile the two executables.