You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.1 KiB
Markdown

2 years ago
# Cozo C lib
2 years ago
[![C](https://img.shields.io/github/v/release/cozodb/cozo)](https://github.com/cozodb/cozo/releases)
2 years ago
This directory contains the source of the Cozo C API.
2 years ago
This document describes how to set up the C library.
To learn how to use CozoDB (CozoScript), follow
the [tutorial](https://github.com/cozodb/cozo-docs/blob/main/tutorial/tutorial.ipynb)
2 years ago
first and then read the [manual](https://cozodb.github.io/current/manual/). You can run all the queries
described in the tutorial with an in-browser DB [here](https://cozodb.github.io/wasm-demo/).
You can download pre-built libraries from the [release page](https://github.com/cozodb/cozo/releases),
look for those starting with `libcozo_c`.
2 years ago
The API is contained in this single [header file](./cozo_c.h).
An example for using the API is [here](./example.c).
To build and run the example:
2 years ago
```bash
gcc -L../target/release/ -lcozo_c example.c -o example && ./example
2 years ago
```
2 years ago
2 years ago
# Building Cozo from source
2 years ago
2 years ago
You need to install the [Rust toolchain](https://www.rust-lang.org/tools/install) on your system. Then:
2 years ago
```bash
2 years ago
cargo build --release -p cozo_c -F compact -F storage-rocksdb
2 years ago
```