10 releases

0.4.6 Jan 20, 2025
0.4.5 Jan 12, 2025
0.4.3 Dec 23, 2024
0.4.1 Nov 10, 2024
0.2.1 Sep 6, 2024

#14 in #sql-server

Download history 216/week @ 2024-12-19 25/week @ 2024-12-26 136/week @ 2025-01-02 148/week @ 2025-01-09 125/week @ 2025-01-16 5/week @ 2025-01-23 9/week @ 2025-01-30 18/week @ 2025-02-06 3/week @ 2025-02-13 1/week @ 2025-02-20 5/week @ 2025-02-27 2/week @ 2025-03-06

901 downloads per month

Apache-2.0

215KB
5K SLoC

DataFusion Flight SQL Server

The datafusion-flight-sql-server is a Flight SQL server that implements the necessary endpoints to use DataFusion as the query engine.

Getting Started

To use datafusion-flight-sql-server in your Rust project, run:

$ cargo add datafusion-flight-sql-server

Example

Here's a basic example of setting up a Flight SQL server:

use datafusion_flight_sql_server::service::FlightSqlService;
use datafusion::{
    execution::{
        context::SessionContext,
        options::CsvReadOptions,
    },
};

async {
    let dsn: String = "0.0.0.0:50051".to_string();
    let remote_ctx = SessionContext::new();
    remote_ctx
        .register_csv("test", "./examples/test.csv", CsvReadOptions::new())
        .await.expect("Register csv");

    FlightSqlService::new(remote_ctx.state()).serve(dsn.clone())
        .await
        .expect("Run flight sql service");

};

This example sets up a Flight SQL server listening on 127.0.0.1:50051.

Dependencies

~86MB
~2M SLoC