flight-sql-client 0.1.0

A Rust client library for Arrow Flight SQL servers
docs.rs failed to build flight-sql-client-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

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.