pub struct DialectCapabilityGuard;Expand description
Fail-fast guard that checks database dialect capabilities before SQL generation.
Call DialectCapabilityGuard::check during query planning to produce
a FraiseQLError::Unsupported with actionable guidance instead of a
cryptic driver error.
Implementations§
Source§impl DialectCapabilityGuard
impl DialectCapabilityGuard
Sourcepub fn check(
dialect: DatabaseType,
feature: Feature,
) -> Result<(), FraiseQLError>
pub fn check( dialect: DatabaseType, feature: Feature, ) -> Result<(), FraiseQLError>
Check that dialect supports feature.
Returns Ok(()) if the feature is supported, or
Err(FraiseQLError::Unsupported) with a human-readable message.
§Errors
Returns FraiseQLError::Unsupported when the feature is not available
on the specified dialect.
Sourcepub fn check_all(
dialect: DatabaseType,
features: &[Feature],
) -> Result<(), FraiseQLError>
pub fn check_all( dialect: DatabaseType, features: &[Feature], ) -> Result<(), FraiseQLError>
Check multiple features at once and return all unsupported ones.
Unlike check, this collects all failures before returning, giving
the developer a complete picture in a single error message.
§Errors
Returns FraiseQLError::Unsupported listing all unsupported features
if any are unsupported.
Auto Trait Implementations§
impl Freeze for DialectCapabilityGuard
impl RefUnwindSafe for DialectCapabilityGuard
impl Send for DialectCapabilityGuard
impl Sync for DialectCapabilityGuard
impl Unpin for DialectCapabilityGuard
impl UnsafeUnpin for DialectCapabilityGuard
impl UnwindSafe for DialectCapabilityGuard
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
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>
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>
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