pub async fn start_flight_server(
client: Option<Arc<dyn RegistryClient>>,
dataset_name: &str,
config: FlightConfig,
) -> Result<(), Box<dyn Error + Send + Sync>>Expand description
Start the Flight SQL server
This function is called by hyprstream serve to embed the Flight SQL server
alongside the HTTP API.
§Arguments
client- Optional registry client to look up datasetdataset_name- Name of the dataset in the registry (required if client provided)config- Flight server configuration
If client is None, starts with an in-memory database. Otherwise looks up
the dataset in the registry and uses file-backed storage if available.
§Example
ⓘ
let client = LocalService::start(&base_dir).await?;
let config = FlightConfig::default().with_port(50051);
// Start with dataset from registry
tokio::spawn(async move {
start_flight_server(Arc::new(client), "my-metrics", config).await
});
// Or start with in-memory database
start_flight_server(None, "", config).await?;