> ## Documentation Index
> Fetch the complete documentation index at: https://ladygraph.io.vn/llms.txt
> Use this file to discover all available pages before exploring further.

# Flight server

> Build the server that lets other machines read an index and save into it.

`ladybug-flight-server` lets other machines read an index and save into it. Its source is the `ladybug-adbc-rs` folder: the upstream project, [LadybugDB/ladybug-adbc-rs](https://github.com/LadybugDB/ladybug-adbc-rs), plus a ladyGraph patch.

The patch adds a `transaction` action, bound parameters, read and write tokens, a larger message limit, and read-only plain queries. It is `src/ladygraph.rs` plus small edits to `server.rs`, `main.rs` and `Cargo.toml`. The folder's own `README.md` documents the action and the options.

Reading also works against a stock upstream server. Saving needs the patched one.

## Build it

```bash theme={null}
cd ../ladybug-adbc-rs
LBUG_BUILD_FROM_SOURCE=1 cargo build --release --no-default-features --bin ladybug-flight-server
# result: ../ladybug-adbc-rs/target/release/ladybug-flight-server
```

This needs Rust, CMake and a C++ compiler, and the first build takes about 20 minutes. Upstream forces Linux prebuilts through `.cargo/config.toml`. To compile the engine from source as above, that file must be renamed to `.cargo/config.toml.off`. To use the Linux and Docker route instead, keep it as `config.toml`.

## Two things to know

* **Match the engine version.** The server and the `ladybug` Python package must be built on the same Ladybug engine version. Each new engine rewrites a file on the first write, and an older engine then refuses it.
* **The binary is found for you.** `tests/flight_server.py` looks at `LADYBUG_FLIGHT_SERVER`, then your `PATH`, then a default path under `ladybug-adbc-rs/target/release/`. `tutorial/10_stores/run_db.sh` uses `LADYBUG_FLIGHT_SERVER` if it is set. Without a server binary, the Flight tests skip.

## Use it

`LadybugFlightStore` connects to the server. The build, search and benchmark scripts read the login from `LADYGRAPH_READ_TOKEN` and `LADYGRAPH_WRITE_TOKEN`. See [Environment variables](https://ladygraph.io.vn/reference/environment-variables.md).

> [card] [Storage](https://ladygraph.io.vn/concepts/storage.md)
>
> How a save stays safe, and what the tables hold.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.