Skip to main content

PostgreSqlDialect

Struct PostgreSqlDialect 

Source
pub struct PostgreSqlDialect { /* private fields */ }
Expand description

The PostgreSQL dialect and its own state.

Trait Implementations§

Source§

impl BitwiseAggregates for PostgreSqlDialect

Source§

impl Clone for PostgreSqlDialect

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl ConditionalAggregates for PostgreSqlDialect

Source§

fn aggregate_filter( b: &mut Builder<Self>, aggregate: &str, column: Option<&str>, condition: &str, alias: &str, ) -> Result<String>

aggregate(column | *) FILTER (WHERE condition).

Source§

impl CrossJoins for PostgreSqlDialect

Source§

impl Cube for PostgreSqlDialect

Source§

fn with_cube(b: &mut Builder<Self>)

Sets the dialect’s cube modifier.
Source§

impl Default for PostgreSqlDialect

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Dialect for PostgreSqlDialect

Source§

const CLASS: &'static str = "Utopia\\Query\\Builder\\PostgreSQL"

The PHP class (Utopia\Query\Builder\MySQL), as messages name it.
Source§

const WRAP: char = '"'

The identifier quote character.
Source§

const LITERAL: StringLiteral = crate::StringLiteral::Extended

How the dialect writes and reads a string literal. Read more
Source§

fn base_step( b: &mut Builder<Self>, step: Step, arguments: &[Arg<'_>], ) -> Option<Result<Ret>>

A step only some dialects have, run as the dialect itself does: None where the dialect has no such step.
Source§

fn quote_string(value: &[u8]) -> Vec<u8> ⓘ

A string literal for to_raw_sql(): \ doubled and ' doubled (PostgreSQL and SQLite double only ', since \ is not an escape in their standard strings). Read more
Source§

fn compile_random(_b: &Builder<Self>) -> String

The random-order expression (RAND()).
Source§

fn compile_regex( b: &mut Builder<Self>, attribute: &str, values: &Array, column: Option<&str>, ) -> Result<String>

A regex filter on the wrapped attribute.
Source§

fn compile_contains_all( b: &mut Builder<Self>, attribute: &str, values: &Array, column: Option<&str>, ) -> Result<String>

containsAll (LIKE '%v%', ANDed).
Source§

fn compile_filter(b: &mut Builder<Self>, query: &Query) -> Result<String>

A filter query (the base compiles comparisons, LIKE, IN, logical and raw filters).
Source§

fn like_keyword(_b: &Builder<Self>) -> &'static str

The LIKE keyword (ILIKE on PostgreSQL).
Source§

fn should_emit_offset( _b: &Builder<Self>, offset: Option<i64>, _limit: Option<i64>, ) -> Result<bool>

Whether to emit OFFSET; the base refuses an offset without a limit.
Source§

fn compile_vector_order_expression( b: &mut Builder<Self>, ) -> Result<Option<Condition>>

An ORDER BY vector distance expression (PostgreSQL).
Source§

fn build(b: &mut Builder<Self>) -> Result<Statement>

Compiles the select statement.
Source§

fn insert(b: &mut Builder<Self>) -> Result<Statement>

Compiles the insert statement.
Source§

fn insert_default_values(b: &mut Builder<Self>) -> Result<Statement>

INSERT ... DEFAULT VALUES.
Source§

fn update(b: &mut Builder<Self>) -> Result<Statement>

Compiles the update statement.
Source§

fn delete(b: &mut Builder<Self>) -> Result<Statement>

Compiles the delete statement.
Source§

fn explain( b: &mut Builder<Self>, analyze: bool, options: &ExplainOptions, ) -> Result<Statement>

EXPLAIN of the select statement.
Source§

fn reset(b: &mut Builder<Self>)

Clears the dialect’s own state (after the shared state is cleared).
Source§

fn ast_dialect() -> AstDialect

The serializer fromAst/toAst use for expressions.
Source§

const LIKE_ESCAPE: u8 = b'\\'

The character that escapes %, _ and itself in a LIKE pattern. Read more
Source§

const DECLARES_LIKE_ESCAPE: bool = false

Whether a LIKE names its escape character (LIKE ? ESCAPE '!'). Read more
Source§

const IMPLICIT_LIKE_ESCAPE: Option<u8>

The character LIKE escapes with when a pattern declares none; None when it escapes nothing, as in SQLite. Read more
Source§

fn quote(_b: &Builder<Self>, identifier: &str) -> Result<String>

Quotes an identifier (`users`.`id`).
Source§

fn compile_like( b: &mut Builder<Self>, attribute: &str, values: &Array, prefix: &str, suffix: &str, not: bool, column: Option<&str>, ) -> Result<String>

LIKE with a prefix and suffix around the escaped value.
Source§

fn compile_contains( b: &mut Builder<Self>, attribute: &str, values: &Array, column: Option<&str>, ) -> Result<String>

contains (LIKE '%v%', ORed for several values).
Source§

fn compile_not_contains( b: &mut Builder<Self>, attribute: &str, values: &Array, column: Option<&str>, ) -> Result<String>

notContains (NOT LIKE '%v%', ANDed).
Source§

fn build_table_clause(b: &mut Builder<Self>) -> Result<String>

The FROM clause.
Source§

fn build_after_joins_clause( _b: &mut Builder<Self>, _grouped: &ParsedQuery, ) -> Result<String>

Clauses after the joins and before WHERE (ClickHouse ARRAY JOIN, PREWHERE).
Source§

fn build_after_group_by_clause(_b: &mut Builder<Self>) -> Result<String>

Clauses after GROUP BY (ClickHouse WITH TOTALS).
Source§

fn build_after_order_by_clause(_b: &mut Builder<Self>) -> Result<String>

Clauses after ORDER BY (ClickHouse LIMIT BY).
Source§

fn build_settings_clause(_b: &mut Builder<Self>) -> Result<String>

Clauses at the very end of a select (ClickHouse SETTINGS).
Source§

fn wrap_union_member(_b: &Builder<Self>, sql: &str) -> String

One member of a UNION chain (parenthesised by default).
Source§

fn compile_group_by_time_bucket( _b: &mut Builder<Self>, _attribute: &str, _interval: &str, ) -> Result<String>

A groupByTimeBucket expression; unsupported by default.
Source§

fn resolve_join_filter_placement( _b: &Builder<Self>, requested: Placement, is_cross_join: bool, ) -> Placement

Where a join filter’s condition goes (cross and natural joins have no ON).
Source§

fn compile_join_with_builder( b: &mut Builder<Self>, query: &Query, join: &JoinBuilder, ) -> Result<String>

The ON of a join built with a JoinBuilder.
Source§

fn add_hook(b: &mut Builder<Self>, hook: Hook) -> Result<()>

Adds a hook.
Source§

fn set(b: &mut Builder<Self>, row: Array) -> Result<()>

Adds a row to insert or the values to update.
Source§

impl FullOuterJoins for PostgreSqlDialect

Source§

impl FullTextSearch for PostgreSqlDialect

Adds the search (MongoDB keeps it apart from filters).
Source§

impl InsertOrIgnore for PostgreSqlDialect

Source§

fn insert_or_ignore(b: &mut Builder<Self>) -> Result<Statement>

Compiles the insert that skips conflicting rows.
Source§

impl Json for PostgreSqlDialect

Source§

fn set_json_append( b: &mut Builder<Self>, column: &str, values: &Array, ) -> Result<()>

Appends values to a JSON array column.
Source§

fn set_json_prepend( b: &mut Builder<Self>, column: &str, values: &Array, ) -> Result<()>

Prepends values to a JSON array column.
Source§

fn set_json_insert( b: &mut Builder<Self>, column: &str, index: i64, value: Value, ) -> Result<()>

Inserts value at index of a JSON array column.
Source§

fn set_json_remove( b: &mut Builder<Self>, column: &str, value: Value, ) -> Result<()>

Removes value from a JSON array column.
Source§

fn set_json_intersect( b: &mut Builder<Self>, column: &str, values: &Array, ) -> Result<()>

Keeps the elements also in values.
Source§

fn set_json_diff( b: &mut Builder<Self>, column: &str, values: &Array, ) -> Result<()>

Removes the elements in values.
Source§

fn set_json_unique(b: &mut Builder<Self>, column: &str) -> Result<()>

Removes duplicate elements.
Source§

fn set_json_path( b: &mut Builder<Self>, column: &str, path: &str, value: Value, ) -> Result<()>

Sets the value at a JSON path.
Source§

impl LateralJoins for PostgreSqlDialect

Source§

impl Locking for PostgreSqlDialect

Source§

impl NegatedFullTextSearch for PostgreSqlDialect

Source§

impl RawSql for PostgreSqlDialect

Source§

impl Returning for PostgreSqlDialect

Source§

impl Rollup for PostgreSqlDialect

Source§

fn with_rollup(b: &mut Builder<Self>)

Sets the dialect’s rollup modifier.
Source§

impl Sequences for PostgreSqlDialect

Source§

fn sequence_expression( _b: &mut Builder<Self>, next: bool, sequence: &str, ) -> Result<String>

The select expression of function (next or current) on sequence (validated).
Source§

impl Spatial for PostgreSqlDialect

Source§

impl SqlDialect for PostgreSqlDialect

Source§

fn compile_search_expression( b: &mut Builder<Self>, attribute: &str, values: &Array, not: bool, ) -> Result<String>

Full-text search on the wrapped attribute.
Source§

fn compile_spatial_filter( b: &mut Builder<Self>, method: Method, attribute: &str, query: &Query, ) -> Result<String>

A spatial filter (MariaDB checks units first).
Source§

fn compile_spatial_distance( b: &mut Builder<Self>, method: Method, attribute: &str, values: &Array, ) -> Result<String>

A distance* predicate.
Source§

fn compile_spatial_predicate( b: &mut Builder<Self>, function: &str, attribute: &str, values: &Array, not: bool, ) -> Result<String>

A spatial predicate function (ST_Intersects, …), negated with NOT.
Source§

fn compile_spatial_covers_predicate( b: &mut Builder<Self>, attribute: &str, values: &Array, not: bool, ) -> Result<String>

covers / notCovers (MySQL ST_Contains, PostgreSQL ST_Covers).
Source§

fn compile_json_contains_expression( b: &mut Builder<Self>, attribute: &str, values: &Array, not: bool, ) -> Result<String>

jsonContains / jsonNotContains.
Source§

fn compile_json_overlaps_expression( b: &mut Builder<Self>, attribute: &str, values: &Array, ) -> Result<String>

jsonOverlaps.
Source§

fn compile_json_path_expression( b: &mut Builder<Self>, attribute: &str, values: &Array, ) -> Result<String>

jsonPath.
Source§

fn compile_conflict_header(b: &mut Builder<Self>) -> Result<String>

The start of the conflict clause (ON DUPLICATE KEY UPDATE).
Source§

fn compile_conflict_assignment(wrapped: &str) -> String

The new value of a conflicting column (VALUES(col), excluded.col).
Source§

fn compile_array_filter( b: &mut Builder<Self>, method: Method, attribute: &str, query: &Query, ) -> Result<String>

A filter on an array attribute (contains on arrays, …).
Source§

impl StatisticalAggregates for PostgreSqlDialect

Source§

impl StringAggregates for PostgreSqlDialect

Source§

fn group_concat_expr(column: &str, order_by: &str) -> String

The concatenation of column (wrapped) with an ORDER BY fragment.
Source§

fn json_array_agg_expr(column: &str) -> String

The JSON array aggregate of column.
Source§

fn json_object_agg_expr(key: &str, value: &str) -> String

The JSON object aggregate of key and value columns.
Source§

impl TableSampling for PostgreSqlDialect

Source§

fn tablesample(b: &mut Builder<Self>, percent: f64, method: &str) -> Result<()>

Samples percent of the table with method (PHP’s default BERNOULLI).
Source§

impl Transactions for PostgreSqlDialect

Source§

impl Upsert for PostgreSqlDialect

Source§

fn upsert(b: &mut Builder<Self>) -> Result<Statement>

Compiles the upsert.
Source§

impl UpsertSelect for PostgreSqlDialect

Source§

fn upsert_select(b: &mut Builder<Self>) -> Result<Statement>

Compiles the upsert from a select.

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.