pub struct DialectInfo {
pub name: &'static str,
pub display_name: &'static str,
pub aliases: &'static [&'static str],
pub dialect_family: DialectFamily,
pub family: &'static str,
pub is_cloud_native: bool,
pub is_olap: bool,
pub is_postgres_compatible: bool,
pub versions: &'static [EngineVersion],
pub deploy_script: Option<DeployScript>,
}Expand description
Metadata describing a dialect implementation.
Serializes to the discovery payload returned by list_platforms() across
every surface (and consumed by the typed-constants generator), so hosts learn
the registered platforms — including third-party plugins — at runtime instead
of hard-coding them.
Fields§
§name: &'static strMachine-readable name (e.g., “postgres”, “redshift”).
display_name: &'static strHuman-readable display name (e.g., “PostgreSQL”, “Amazon Redshift”).
aliases: &'static [&'static str]The other spellings this dialect answers to (e.g. ["pg", "postgresql"]).
A dialect owns its own names. name always resolves; this
is everything else a design or a --target may say for the same
platform. Matching ignores case and surrounding whitespace, so
"PostgreSQL" needs no separate entry. Declare &[] to answer to
name alone.
Two loaded dialects must not claim the same spelling: a spelling that names two platforms names neither, and resolving it is refused rather than guessed.
dialect_family: DialectFamilyDialect family for shared behavior (e.g., PostgreSQL, TSql).
family: &'static strSQL family label (e.g., “PostgreSQL”, “T-SQL”, “ClickHouse SQL”).
is_cloud_native: boolWhether this is a cloud-native platform (e.g. Snowflake, Databricks).
is_olap: boolWhether this is primarily an OLAP engine (e.g. ClickHouse).
is_postgres_compatible: boolWhether this dialect is PostgreSQL-wire-compatible.
versions: &'static [EngineVersion]The versions of the engine this dialect answers for, the floor first, then each version above it at which an answer changes.
The floor is the oldest version the dialect is supported at, and a
platform named with no version (postgres) is the engine at its floor.
A design opts into a newer server’s forms by naming one of the others
(postgres@17). Declare &[] for a managed service that chooses its
own version, where a version named in a design is refused.
Each version is one a dialect has been measured at. A dialect whose answers are the same at every version declares one: its floor.
deploy_script: Option<DeployScript>Which client a bundle’s deploy script drives for this engine, or
None where there is no script.
A bundle carries one script, written for one client: psql, mysql,
sqlplus. Razeri asks the dialect which one its engine speaks rather
than recognising the engine by name, so an engine that speaks a client
razeri already drives — a PostgreSQL-wire engine and psql — gets that
script with no change to razeri. An engine whose client razeri does not
drive describes it with DeployScript::Client, and razeri writes a
script around that description. None gets a script that refuses at
the door and prints the run order by hand.
Implementations§
Source§impl DialectInfo
impl DialectInfo
Sourcepub fn spellings(&self) -> Vec<&'static str>
pub fn spellings(&self) -> Vec<&'static str>
Every spelling this dialect answers to: its own name, then its aliases.
This is what the resolver reads, so it is also the honest answer to “what may a design call this platform?”. An alias repeating the name is listed once.
Sourcepub fn answers_to(&self, spelling: &str) -> bool
pub fn answers_to(&self, spelling: &str) -> bool
Whether this dialect answers to spelling, ignoring case and
surrounding whitespace.