#[non_exhaustive]pub enum Dialect {
Postgres,
MySql,
Athena,
Sqlite,
}Expand description
Supported SQL dialects (4-variant per spike 005).
#[non_exhaustive] permits additive evolution to Oracle / SqlServer /
DuckDb / ClickHouse in later phases without semver break.
§Example
use pmcp_server_toolkit::sql::Dialect;
assert_eq!(Dialect::Postgres.name(), "PostgreSQL");
assert!(Dialect::Sqlite.placeholder_guidance().contains(":name"));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Postgres
PostgreSQL — positional $1, $2, … placeholders.
MySql
MySQL — positional ? placeholders.
Athena
Amazon Athena (Presto/Trino) — positional ? placeholders.
Sqlite
SQLite — named :name or positional ? placeholders.
Implementations§
Source§impl Dialect
impl Dialect
Sourcepub const fn name(self) -> &'static str
pub const fn name(self) -> &'static str
Stable, human-readable name for prompts and logs.
§Example
use pmcp_server_toolkit::sql::Dialect;
assert_eq!(Dialect::MySql.name(), "MySQL");Sourcepub const fn placeholder_guidance(self) -> &'static str
pub const fn placeholder_guidance(self) -> &'static str
One-line guidance string for the code-mode prompt body explaining the
dialect’s placeholder convention. Used by assemble_code_mode_prompt
even though Phase 83 does not ship translate_placeholders — the LLM
still benefits from knowing the eventual binding shape.
§Example
use pmcp_server_toolkit::sql::Dialect;
assert!(Dialect::Postgres.placeholder_guidance().contains("$1"));Trait Implementations§
impl Copy for Dialect
impl Eq for Dialect
impl StructuralPartialEq for Dialect
Auto Trait Implementations§
impl Freeze for Dialect
impl RefUnwindSafe for Dialect
impl Send for Dialect
impl Sync for Dialect
impl Unpin for Dialect
impl UnsafeUnpin for Dialect
impl UnwindSafe for Dialect
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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 moreCreates a shared type from an unshared type.