flight-sql-client

Crates.ioflight-sql-client
lib.rsflight-sql-client
version0.1.0
created_at2025-11-13 14:40:43.564679+00
updated_at2025-11-13 14:40:43.564679+00
descriptionA Rust client library for Arrow Flight SQL servers
homepage
repositoryhttps://github.com/swanlake-io/swanlake
max_upload_size
id1931300
size82,580
Wang Fenjin (wangfenjin)

documentation

README

flight-sql-client

A Rust client library for connecting to Arrow Flight SQL servers, built on top of ADBC drivers. Designed for use with SwanLake, an Arrow Flight SQL server backed by DuckDB.

Installation

Add this to your Cargo.toml:

[dependencies]
flight-sql-client = "0.1.0"

Usage

Connect to a SwanLake server and execute a query:

use flight_sql_client::FlightSQLClient;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Connect to the server
    let mut client = FlightSQLClient::connect("grpc://localhost:4214")?;

    // Execute a query
    let result = client.execute("SELECT 1 as col")?;
    println!("Total rows: {}", result.total_rows);

    // Execute an update
    let update_result = client.execute_update("CREATE TABLE test (id INTEGER)")?;
    println!("Rows affected: {:?}", update_result.rows_affected);

    Ok(())
}

API Overview

  • FlightSQLClient: Main client for executing queries and updates.
  • QueryResult: Holds query results with record batches.
  • UpdateResult: Holds update results with affected rows.

See the SwanLake repository for more examples and server setup.

License

Licensed under the MIT License.

Commit count: 0

cargo fmt