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_type_name(&self, ty: ScalarFieldType) -> Option<&'static str>

SQL type name this dialect casts a JSON-extracted value to for ty, or None when the raw text extraction is already the right type. Read more
Source§

fn cast_expr_as<'a>(&self, expr: &'a str, ty: ScalarFieldType) -> Cow<'a, str>

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

fn cast_param_as<'a>( &self, placeholder: &'a str, ty: ScalarFieldType, ) -> Cow<'a, str>

Wrap a parameter placeholder so it is compared as ty. 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 fts_rank_sql( &self, document_expr: &str, query_param: &str, ) -> Result<String, UnsupportedOperator>

SQL for the full-text relevance of a document against a web-search query — the ordering half of ?search= (#1284). 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 inet_check_sql( &self, lhs: &str, check_name: &str, ) -> Result<String, UnsupportedOperator>

Generate SQL for an INET unary check (IsIPv4, IsIPv6, IsPrivate, IsPublic, IsLoopback, IsNotLoopback). 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 ltree_id_subquery_sql( &self, pg_op: &str, field_expr: &str, table: &str, path_column: &str, fk_column: Option<&str>, param: &str, ) -> Result<String, UnsupportedOperator>

Generate SQL for ID-based ltree operators (descendantOfId, ancestorOfId). 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 like_escape_clause(&self) -> &'static str

Trailing ESCAPE clause required to make escape_like_literal’s backslash escaping effective on this dialect, or "" when the dialect already treats \ as the escape character. 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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. 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 = !

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

fn try_from(value: U) -> Result<T, !>

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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