pub struct ComputeEngine { /* private fields */ }Expand description
SQL execution engine wrapping a DataFusion SessionContext.
Implementations§
Source§impl ComputeEngine
impl ComputeEngine
Sourcepub async fn from_config(cfg: &ComputeConfig) -> Result<Self>
pub async fn from_config(cfg: &ComputeConfig) -> Result<Self>
Create a new engine and auto-register datasets found under data_dir.
pub fn data_dir(&self) -> &Path
pub fn max_rows(&self) -> usize
Sourcepub async fn refresh_datasets(&mut self) -> Result<Vec<String>>
pub async fn refresh_datasets(&mut self) -> Result<Vec<String>>
Scan the data directory and register Parquet/CSV files as tables.
Table names are derived from file stems (sanitized to SQL identifiers).
Sourcepub async fn list_tables(&self) -> Result<Vec<String>>
pub async fn list_tables(&self) -> Result<Vec<String>>
List currently registered table names.
Sourcepub async fn sql(&self, request: QueryRequest) -> Result<QueryResponse>
pub async fn sql(&self, request: QueryRequest) -> Result<QueryResponse>
Execute a validated SQL query and return a JSON-friendly result set.
Sourcepub fn context(&self) -> Arc<SessionContext>
pub fn context(&self) -> Arc<SessionContext>
Shared context for advanced callers.
Auto Trait Implementations§
impl !RefUnwindSafe for ComputeEngine
impl !UnwindSafe for ComputeEngine
impl Freeze for ComputeEngine
impl Send for ComputeEngine
impl Sync for ComputeEngine
impl Unpin for ComputeEngine
impl UnsafeUnpin for ComputeEngine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more