pub struct PostgresDialect;Expand description
PostgreSQL dialect for GenericWhereGenerator.
Trait Implementations§
Source§impl SqlDialect for PostgresDialect
impl SqlDialect for PostgresDialect
Source§fn quote_identifier(&self, name: &str) -> String
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
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
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>
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>
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>
fn cast_param_numeric<'a>(&self, placeholder: &'a str) -> Cow<'a, str>
Wrap a parameter placeholder for numeric comparison. Read more
Source§fn ilike_sql(&self, lhs: &str, rhs: &str) -> String
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
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>
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>
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>
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>
fn fts_matches_sql( &self, expr: &str, param: &str, ) -> Result<String, UnsupportedOperator>
SQL for
to_tsvector(expr) @@ to_tsquery(param). Read moreSource§fn fts_plain_query_sql(
&self,
expr: &str,
param: &str,
) -> Result<String, UnsupportedOperator>
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>
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>
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>
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>
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>
fn jaccard_distance_sql( &self, lhs: &str, rhs: &str, ) -> Result<String, UnsupportedOperator>
Generate SQL for Jaccard distance (
::text[] <%> ::text[]). Read moreSource§fn inet_check_sql(
&self,
lhs: &str,
check_name: &str,
) -> Result<String, UnsupportedOperator>
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>
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>
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>
fn ltree_any_lquery_sql( &self, lhs: &str, placeholders: &[String], ) -> Result<String, UnsupportedOperator>
Generate SQL for
ltree ? ARRAY[...] (MatchesAnyLquery). Read moreSource§fn ltree_depth_sql(
&self,
op: &str,
lhs: &str,
rhs: &str,
) -> Result<String, UnsupportedOperator>
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 moreSource§fn ltree_lca_sql(
&self,
lhs: &str,
placeholders: &[String],
) -> Result<String, UnsupportedOperator>
fn ltree_lca_sql( &self, lhs: &str, placeholders: &[String], ) -> Result<String, UnsupportedOperator>
Generate SQL for
ltree = lca(ARRAY[...]) (Lca operator). Read moreSource§fn row_view_column_expr(
&self,
json_column: &str,
field_name: &str,
col_type: &RowViewColumnType,
) -> String
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 moreSource§fn generate_extended_sql(
&self,
operator: &ExtendedOperator,
field_sql: &str,
params: &mut Vec<Value>,
) -> Result<String>
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
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
fn concat_sql(&self, parts: &[&str]) -> String
String concatenation operator / function for building LIKE patterns. Read more
Source§fn always_false(&self) -> &'static str
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
fn always_true(&self) -> &'static str
SQL literal for “always true” (used for empty AND). Read more
Source§fn neq_operator(&self) -> &'static str
fn neq_operator(&self) -> &'static str
SQL inequality operator. Default
!=. SQL Server uses <>.Auto Trait Implementations§
impl Freeze for PostgresDialect
impl RefUnwindSafe for PostgresDialect
impl Send for PostgresDialect
impl Sync for PostgresDialect
impl Unpin for PostgresDialect
impl UnsafeUnpin for PostgresDialect
impl UnwindSafe for PostgresDialect
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> 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 more