pub struct Runner<'a> { /* private fields */ }Expand description
Runs SQL for the tools: user SQL through the gate, internal SQL without it.
Implementations§
Source§impl<'a> Runner<'a>
impl<'a> Runner<'a>
pub fn new(state: &'a AppState) -> Runner<'a>
Sourcepub async fn user_query(
&self,
database: Option<&str>,
sql: &str,
ct: &CancellationToken,
) -> Result<QueryEnvelope, ToolError>
pub async fn user_query( &self, database: Option<&str>, sql: &str, ct: &CancellationToken, ) -> Result<QueryEnvelope, ToolError>
Gates the SQL, runs it read-only and encodes the rows.
Sourcepub async fn internal_query(
&self,
database: Option<&str>,
sql: &str,
params: &[Option<&str>],
ct: &CancellationToken,
) -> Result<QueryEnvelope, ToolError>
pub async fn internal_query( &self, database: Option<&str>, sql: &str, params: &[Option<&str>], ct: &CancellationToken, ) -> Result<QueryEnvelope, ToolError>
Runs internal SQL (no gate) and encodes the rows.
Sourcepub async fn internal_raw(
&self,
database: Option<&str>,
statement: Statement<'_>,
ct: &CancellationToken,
) -> Result<(String, RunOutput), ToolError>
pub async fn internal_raw( &self, database: Option<&str>, statement: Statement<'_>, ct: &CancellationToken, ) -> Result<(String, RunOutput), ToolError>
Runs internal SQL and returns the database name with the raw output.
Sourcepub async fn internal_generic(
&self,
database: Option<&str>,
sql: &str,
fetch: FetchLimits,
offset: Option<u32>,
ct: &CancellationToken,
) -> Result<(String, RunOutput), ToolError>
pub async fn internal_generic( &self, database: Option<&str>, sql: &str, fetch: FetchLimits, offset: Option<u32>, ct: &CancellationToken, ) -> Result<(String, RunOutput), ToolError>
Runs a generic-plan EXPLAIN text through the simple protocol behind the server-side preflight.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Runner<'a>
impl<'a> !UnwindSafe for Runner<'a>
impl<'a> Forget for Runner<'a>
impl<'a> Freeze for Runner<'a>
impl<'a> Move for Runner<'a>
impl<'a> Send for Runner<'a>
impl<'a> Sync for Runner<'a>
impl<'a> Unpin for Runner<'a>
impl<'a> UnsafeUnpin for Runner<'a>
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<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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