Skip to main content

PostgresDialect

Struct PostgresDialect 

Source
pub struct PostgresDialect;
Expand description

PostgreSQL dialect for GenericWhereGenerator.

Trait Implementations§

Source§

impl SqlDialect for PostgresDialect

Source§

fn name(&self) -> &'static str

Dialect name for error messages (e.g., "PostgreSQL", "MySQL").
Source§

fn quote_identifier(&self, name: &str) -> String

Quote a database identifier (table or column name). Read more
Source§

fn json_extract_scalar(&self, column: &str, path: &[String]) -> String

Generate SQL to extract a scalar string from a JSON/JSONB column. Read more
Source§

fn placeholder(&self, n: usize) -> String

Next parameter placeholder. Called with the current 1-based index. Read more
Source§

fn cast_to_numeric<'a>(&self, expr: &'a str) -> Cow<'a, str>

Wrap a JSON-extracted scalar expression so it compares numerically. Read more
Source§

fn cast_to_boolean<'a>(&self, expr: &'a str) -> Cow<'a, str>

Wrap a JSON-extracted scalar expression so it compares as a boolean. Read more
Source§

fn cast_param_numeric<'a>(&self, placeholder: &'a str) -> Cow<'a, str>

Wrap a parameter placeholder for numeric comparison. Read more
Source§

fn cast_native_param(&self, placeholder: &str, native_type: &str) -> String

Wrap a parameter placeholder for a native-column equality condition. Read more
Source§

fn ilike_sql(&self, lhs: &str, rhs: &str) -> String

SQL fragment for case-insensitive LIKE. Read more
Source§

fn json_array_length(&self, expr: &str) -> String

SQL expression for the length of a JSON array stored in expr.
Source§

fn array_contains_sql( &self, lhs: &str, rhs: &str, ) -> Result<String, UnsupportedOperator>

SQL for “array contains this element”. Read more
Source§

fn array_contained_by_sql( &self, lhs: &str, rhs: &str, ) -> Result<String, UnsupportedOperator>

SQL for “element is contained by array”. Read more
Source§

fn array_overlaps_sql( &self, lhs: &str, rhs: &str, ) -> Result<String, UnsupportedOperator>

SQL for “arrays overlap”. Read more
Source§

fn fts_matches_sql( &self, expr: &str, param: &str, ) -> Result<String, UnsupportedOperator>

SQL for to_tsvector(expr) @@ to_tsquery(param). Read more
Source§

fn fts_plain_query_sql( &self, expr: &str, param: &str, ) -> Result<String, UnsupportedOperator>

SQL for plain-text full-text search. Read more
Source§

fn fts_phrase_query_sql( &self, expr: &str, param: &str, ) -> Result<String, UnsupportedOperator>

SQL for phrase full-text search. Read more
Source§

fn fts_websearch_query_sql( &self, expr: &str, param: &str, ) -> Result<String, UnsupportedOperator>

SQL for web-search full-text search. Read more
Source§

fn regex_sql( &self, lhs: &str, rhs: &str, case_insensitive: bool, negate: bool, ) -> Result<String, UnsupportedOperator>

SQL for POSIX-style regex match. Read more
Source§

fn vector_distance_sql( &self, pg_op: &str, lhs: &str, rhs: &str, ) -> Result<String, UnsupportedOperator>

Generate SQL for a pgvector distance operator. Read more
Source§

fn jaccard_distance_sql( &self, lhs: &str, rhs: &str, ) -> Result<String, UnsupportedOperator>

Generate SQL for Jaccard distance (::text[] <%> ::text[]). Read more
Source§

fn inet_check_sql( &self, lhs: &str, check_name: &str, ) -> Result<String, UnsupportedOperator>

Generate SQL for an INET unary check (IsIPv4, IsIPv6, IsPrivate, IsPublic, IsLoopback). Read more
Source§

fn inet_binary_sql( &self, pg_op: &str, lhs: &str, rhs: &str, ) -> Result<String, UnsupportedOperator>

Generate SQL for an INET binary operation (InSubnet, ContainsSubnet, ContainsIP, Overlaps). Read more
Source§

fn ltree_binary_sql( &self, pg_op: &str, lhs: &str, rhs: &str, rhs_type: &str, ) -> Result<String, UnsupportedOperator>

Generate SQL for an LTree binary operator. Read more
Source§

fn ltree_any_lquery_sql( &self, lhs: &str, placeholders: &[String], ) -> Result<String, UnsupportedOperator>

Generate SQL for ltree ? ARRAY[...] (MatchesAnyLquery). Read more
Source§

fn ltree_depth_sql( &self, op: &str, lhs: &str, rhs: &str, ) -> Result<String, UnsupportedOperator>

Generate SQL for nlevel(ltree) OP param (depth comparison operators). Read more
Source§

fn ltree_lca_sql( &self, lhs: &str, placeholders: &[String], ) -> Result<String, UnsupportedOperator>

Generate SQL for ltree = lca(ARRAY[...]) (Lca operator). Read more
Source§

fn row_view_column_expr( &self, json_column: &str, field_name: &str, col_type: &RowViewColumnType, ) -> String

Generate a SQL expression that extracts a scalar field from a JSON column and casts it to the given RowViewColumnType. Read more
Source§

fn generate_extended_sql( &self, operator: &ExtendedOperator, field_sql: &str, params: &mut Vec<Value>, ) -> Result<String>

Generate SQL for an extended rich-type operator. Read more
Source§

fn like_sql(&self, lhs: &str, rhs: &str) -> String

SQL fragment for case-sensitive LIKE: lhs LIKE rhs.
Source§

fn concat_sql(&self, parts: &[&str]) -> String

String concatenation operator / function for building LIKE patterns. Read more
Source§

fn always_false(&self) -> &'static str

SQL literal for “always false” (used for empty IN clauses, empty OR). Read more
Source§

fn always_true(&self) -> &'static str

SQL literal for “always true” (used for empty AND). Read more
Source§

fn neq_operator(&self) -> &'static str

SQL inequality operator. Default !=. SQL Server uses <>.
Source§

fn create_row_view_ddl( &self, view_name: &str, source_table: &str, columns: &[(String, String)], ) -> String

Generate the full DDL statement(s) to create a row-shaped view. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more