pub struct QueryContext<S = SessionContext>where
S: QuerySession,{ /* private fields */ }Expand description
Query context for interactive data exploration.
Implementations§
Source§impl QueryContext<SessionContext>
impl QueryContext<SessionContext>
Sourcepub fn new(registry: Arc<dyn ConnectorRegistry>) -> Self
pub fn new(registry: Arc<dyn ConnectorRegistry>) -> Self
Create a new query context backed by the provided connector registry.
Source§impl<S> QueryContext<S>where
S: QuerySession,
impl<S> QueryContext<S>where
S: QuerySession,
Sourcepub fn with_session(session: S, registry: Arc<dyn ConnectorRegistry>) -> Self
pub fn with_session(session: S, registry: Arc<dyn ConnectorRegistry>) -> Self
Construct a query context from a custom session implementation.
Sourcepub fn session(&self) -> &SessionContext
pub fn session(&self) -> &SessionContext
Access the underlying DataFusion session.
Sourcepub async fn list_catalogs(&self) -> Vec<String>
pub async fn list_catalogs(&self) -> Vec<String>
List catalogs exposed by this connector.
Sourcepub async fn list_connectors(&self) -> Result<Vec<ConnectionMetadata>>
pub async fn list_connectors(&self) -> Result<Vec<ConnectionMetadata>>
Sourcepub async fn list_registered(&self) -> Result<Vec<ConnectionMetadata>>
pub async fn list_registered(&self) -> Result<Vec<ConnectionMetadata>>
Sourcepub async fn list(
&self,
connector_id: &str,
term: Option<&str>,
) -> Result<ListSummary>
pub async fn list( &self, connector_id: &str, term: Option<&str>, ) -> Result<ListSummary>
List databases, or tables/files for a connector, if supported.
§Errors
- If an error occurs while listing.
Sourcepub async fn execute_query(
&self,
connector_id: Option<&str>,
sql: &str,
) -> Result<SendableRecordBatchStream>
pub async fn execute_query( &self, connector_id: Option<&str>, sql: &str, ) -> Result<SendableRecordBatchStream>
Execute a SQL query through the provided connector.
§Errors
- If an error occurs while executing the query.
Trait Implementations§
Source§impl<S> Clone for QueryContext<S>where
S: QuerySession + Clone,
impl<S> Clone for QueryContext<S>where
S: QuerySession + Clone,
Source§fn clone(&self) -> QueryContext<S>
fn clone(&self) -> QueryContext<S>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<S> Freeze for QueryContext<S>where
S: Freeze,
impl<S = SessionContext> !RefUnwindSafe for QueryContext<S>
impl<S> Send for QueryContext<S>
impl<S> Sync for QueryContext<S>
impl<S> Unpin for QueryContext<S>where
S: Unpin,
impl<S = SessionContext> !UnwindSafe for QueryContext<S>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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