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.