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_type_name(&self, ty: ScalarFieldType) -> Option<&'static str>
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 moreSource§fn cast_expr_as<'a>(&self, expr: &'a str, ty: ScalarFieldType) -> Cow<'a, str>
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 moreSource§fn cast_param_as<'a>(
&self,
placeholder: &'a str,
ty: ScalarFieldType,
) -> Cow<'a, str>
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 moreSource§fn cast_native_param(&self, placeholder: &str, native_type: &str) -> String
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
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 fts_rank_sql(
&self,
document_expr: &str,
query_param: &str,
) -> Result<String, UnsupportedOperator>
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 moreSource§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 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,
IsNotLoopback). 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 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>
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>
Source§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 like_escape_clause(&self) -> &'static str
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 moreSource§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