reifydb-client 0.6.0

Official Rust client library for ReifyDB
Documentation
// SPDX-License-Identifier: MIT
// Copyright (c) 2026 ReifyDB

use std::{env, error::Error};

use reifydb_client::{HttpClient, WireFormat};

#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
	// Connect to the server
	let mut client = HttpClient::connect("http://localhost:8080", WireFormat::Json).await?;

	// Authenticate
	let token = env::var("REIFYDB_TOKEN").unwrap_or_else(|_| "root".to_string());
	client.authenticate(&token);

	println!("Connected to ReifyDB via HTTP");

	// Execute a query
	let result = client.query("from system.tables", None).await?;

	println!("Query executed: {} frames returned", result.len());

	for frame in result {
		println!("{}", frame);
	}

	Ok(())
}