Skip to main content

PlatformDialect

Trait PlatformDialect 

Source
pub trait PlatformDialect:
    SqlRenderer
    + ExpressionRenderer
    + DdlRenderer
    + DmlRenderer
    + ProcedureRenderer
    + FormulaRenderer
    + TaskRenderer
    + DialectCapabilities
    + ReplicationRenderer
    + StorageRenderer
    + DialectHandle {
    // Required method
    fn info(&self) -> DialectInfo;

    // Provided methods
    fn at_version(
        self: Arc<Self>,
        version: &EngineVersion,
    ) -> Result<Arc<dyn PlatformDialect>, UnsupportedVersion> { ... }
    fn engine_version(&self) -> Option<EngineVersion> { ... }
}
Expand description

Full plugin trait for database platform dialects.

Extends the rendering trait hierarchy (SqlRenderer, ExpressionRenderer, DdlRenderer, DmlRenderer, ProcedureRenderer, FormulaRenderer, TaskRenderer, ReplicationRenderer, StorageRenderer, DialectCapabilities) with plugin-specific metadata and registration support.

Dialect authors implement the rendering traits plus PlatformDialect::info().

Required Methods§

Source

fn info(&self) -> DialectInfo

Returns metadata about this dialect.

Provided Methods§

Source

fn at_version( self: Arc<Self>, version: &EngineVersion, ) -> Result<Arc<dyn PlatformDialect>, UnsupportedVersion>

This dialect, answering for version.

version is one of DialectInfo::versions; the resolver calls this after matching the version a design names against that list, so a version the dialect does not declare never reaches it. A dialect whose answers change between its versions returns an instance that answers for version, and says so from Self::engine_version.

The default is a dialect with one answer: it returns itself for a version it declares, and refuses any other.

§Errors

UnsupportedVersion, naming the versions this dialect answers for.

Source

fn engine_version(&self) -> Option<EngineVersion>

The version this dialect answers for, or None for a managed service that chooses its own.

The default is the floor, the first of DialectInfo::versions: right for a dialect with one answer. A dialect that overrides Self::at_version overrides this too.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§