pub struct PgDialect;Expand description
PostgreSQL dialect — generates PG-specific SQL syntax.
Trait Implementations§
Source§impl SqlDialect for PgDialect
impl SqlDialect for PgDialect
Source§fn json_agg_with_columns(
&self,
b: &mut SqlBuilder,
alias: &str,
_columns: &[&str],
)
fn json_agg_with_columns( &self, b: &mut SqlBuilder, alias: &str, _columns: &[&str], )
JSON array aggregation with explicit column names. Read more
Source§fn row_to_json_with_columns(
&self,
b: &mut SqlBuilder,
alias: &str,
_columns: &[&str],
)
fn row_to_json_with_columns( &self, b: &mut SqlBuilder, alias: &str, _columns: &[&str], )
Single-row JSON with explicit column names.
Source§fn count_expr(&self, b: &mut SqlBuilder, expr: &str)
fn count_expr(&self, b: &mut SqlBuilder, expr: &str)
COUNT function with schema qualification. Read more
Source§fn count_star(&self, b: &mut SqlBuilder)
fn count_star(&self, b: &mut SqlBuilder)
COUNT(*) for total counts. Read more
Source§fn set_session_var(&self, b: &mut SqlBuilder, key: &str, value: &str)
fn set_session_var(&self, b: &mut SqlBuilder, key: &str, value: &str)
Set a session/transaction-local variable. Read more
Source§fn get_session_var(&self, b: &mut SqlBuilder, key: &str, column_alias: &str)
fn get_session_var(&self, b: &mut SqlBuilder, key: &str, column_alias: &str)
Read a session variable in a SELECT expression. Read more
Source§fn type_cast(&self, b: &mut SqlBuilder, expr: &str, ty: &str)
fn type_cast(&self, b: &mut SqlBuilder, expr: &str, ty: &str)
Cast an expression to a type. Read more
Source§fn from_json_body(
&self,
b: &mut SqlBuilder,
columns: &[CoercibleField],
json_bytes: &[u8],
)
fn from_json_body( &self, b: &mut SqlBuilder, columns: &[CoercibleField], json_bytes: &[u8], )
FROM clause for unpacking a JSON body into rows. Read more
Source§fn push_type_cast_suffix(&self, b: &mut SqlBuilder, ty: &str)
fn push_type_cast_suffix(&self, b: &mut SqlBuilder, ty: &str)
Append a type cast suffix to the builder. Read more
Source§fn push_array_type_cast_suffix(&self, b: &mut SqlBuilder, ty: &str)
fn push_array_type_cast_suffix(&self, b: &mut SqlBuilder, ty: &str)
Append an array type cast suffix to the builder. Read more
Source§fn quote_ident(&self, ident: &str) -> String
fn quote_ident(&self, ident: &str) -> String
Quote an identifier (table, column, schema name). Read more
Source§fn supports_fts(&self) -> bool
fn supports_fts(&self) -> bool
Full-text search predicate. Read more
Source§fn fts_predicate(
&self,
b: &mut SqlBuilder,
config: Option<&str>,
column: &str,
operator: &str,
)
fn fts_predicate( &self, b: &mut SqlBuilder, config: Option<&str>, column: &str, operator: &str, )
Generate FTS predicate SQL.
Source§fn row_to_json_star(&self, b: &mut SqlBuilder, source: &str)
fn row_to_json_star(&self, b: &mut SqlBuilder, source: &str)
Convert an entire CTE row to JSON text (for scalar function calls). Read more
Source§fn count_star_from(&self, b: &mut SqlBuilder, source: &str)
fn count_star_from(&self, b: &mut SqlBuilder, source: &str)
COUNT(*) subquery for exact count from a CTE source. Read more
Source§fn push_literal(&self, b: &mut SqlBuilder, s: &str)
fn push_literal(&self, b: &mut SqlBuilder, s: &str)
Push a single-quoted SQL literal with proper escaping. Read more
Source§fn supports_lateral_join(&self) -> bool
fn supports_lateral_join(&self) -> bool
Whether the backend supports LATERAL joins. Read more
Source§fn named_param_assign(&self) -> &str
fn named_param_assign(&self) -> &str
Named parameter assignment syntax for function calls. Read more
Source§fn json_agg(&self, b: &mut SqlBuilder, alias: &str)
fn json_agg(&self, b: &mut SqlBuilder, alias: &str)
JSON array aggregation expression. Read more
Source§fn row_to_json(&self, b: &mut SqlBuilder, alias: &str)
fn row_to_json(&self, b: &mut SqlBuilder, alias: &str)
Single-row JSON expression. Read more
Source§fn session_vars_are_select_exprs(&self) -> bool
fn session_vars_are_select_exprs(&self) -> bool
Whether session variable setup uses SELECT-based expressions. Read more
Source§fn build_tx_vars_statement(&self, _b: &mut SqlBuilder, _vars: &[(&str, &str)])
fn build_tx_vars_statement(&self, _b: &mut SqlBuilder, _vars: &[(&str, &str)])
Build a single statement that sets all session/transaction variables. Read more
Source§fn supports_dml_cte(&self) -> bool
fn supports_dml_cte(&self) -> bool
Whether the backend supports DML (INSERT/UPDATE/DELETE) inside CTEs. Read more
impl Copy for PgDialect
Auto Trait Implementations§
impl Freeze for PgDialect
impl RefUnwindSafe for PgDialect
impl Send for PgDialect
impl Sync for PgDialect
impl Unpin for PgDialect
impl UnsafeUnpin for PgDialect
impl UnwindSafe for PgDialect
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<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