Skip to main content

PostgreSQLSqlGenerator

Struct PostgreSQLSqlGenerator 

Source
pub struct PostgreSQLSqlGenerator;
Expand description

PostgreSQL SQL generator implementation

Implementations§

Source§

impl PostgreSQLSqlGenerator

Source

pub fn create_policy_sql(&self, policy: &Policy) -> String

Create RLS policy SQL

Source

pub fn enable_rls_sql(&self, table_name: &str, schema: Option<&str>) -> String

Create RLS enable SQL for a table

Source

pub fn disable_rls_sql(&self, table_name: &str, schema: Option<&str>) -> String

Create RLS disable SQL for a table

Source

pub fn drop_policy_sql(&self, policy: &Policy) -> String

Drop policy SQL

Source

pub fn create_extension_sql(&self, extension: &Extension) -> String

Create extension SQL

Source

pub fn drop_extension_sql(&self, extension: &Extension) -> String

Drop extension SQL

Source

pub fn extension_exists_sql(&self, extension_name: &str) -> String

Check if extension exists SQL

Source

pub fn list_extensions_sql(&self) -> String

List installed extensions SQL

Source

pub fn create_guc_sql(&self, guc: &GucSetting) -> String

Create GUC setting SQL

Source

pub fn reset_guc_sql(&self, guc: &GucSetting) -> String

Reset GUC setting SQL

Source

pub fn get_guc_sql(&self, guc: &GucSetting) -> String

Get GUC setting value SQL

Source

pub fn list_guc_settings_sql(&self) -> String

List all GUC settings SQL

Source

pub fn set_jwt_context_sql( &self, user_id: &str, tenant_id: Option<&str>, role: Option<&str>, ) -> String

Set JWT context SQL

Source

pub fn clear_jwt_context_sql(&self) -> String

Clear JWT context SQL

Trait Implementations§

Source§

impl SqlGenerator for PostgreSQLSqlGenerator

Source§

fn create_table_sql(&self, table: &Table) -> String

Generate CREATE TABLE SQL
Source§

fn create_view_sql(&self, view: &View) -> String

Generate CREATE VIEW SQL
Source§

fn create_index_sql(&self, index: &Index) -> String

Generate CREATE INDEX SQL
Source§

fn create_type_sql(&self, composite_type: &CompositeType) -> String

Generate CREATE TYPE SQL (for composite types)
Source§

fn create_schema_sql(&self, schema_name: &str) -> String

Generate CREATE SCHEMA SQL
Source§

fn alter_table_sql(&self, table: &Table, changes: &[String]) -> String

Generate ALTER TABLE SQL
Source§

fn drop_table_sql(&self, table_name: &str) -> String

Generate DROP TABLE SQL
Source§

fn drop_view_sql(&self, view_name: &str) -> String

Generate DROP VIEW SQL
Source§

fn drop_index_sql(&self, index_name: &str) -> String

Generate DROP INDEX SQL
Source§

fn insert_sql( &self, table_name: &str, columns: &[String], values: &[String], ) -> String

Generate INSERT SQL
Source§

fn update_sql( &self, table_name: &str, set_clause: &str, where_clause: &str, ) -> String

Generate UPDATE SQL
Source§

fn delete_sql(&self, table_name: &str, where_clause: &str) -> String

Generate DELETE SQL
Source§

fn select_sql( &self, table_name: &str, columns: &[String], where_clause: Option<&str>, ) -> String

Generate SELECT SQL
Source§

fn quote_identifier(&self, identifier: &str) -> String

Quote an identifier (table name, column name, etc.)
Source§

fn quote_string(&self, value: &str) -> String

Quote a string literal
Source§

fn current_timestamp_function(&self) -> &str

Get the current timestamp function
Source§

fn auto_increment_keyword(&self) -> &str

Get the auto-increment keyword
Source§

fn create_guc_sql(&self, guc: &GucSetting) -> String

Create GUC setting SQL
Source§

fn reset_guc_sql(&self, guc: &GucSetting) -> String

Reset GUC setting SQL
Source§

fn get_guc_sql(&self, guc: &GucSetting) -> String

Get GUC setting value SQL
Source§

fn list_guc_settings_sql(&self) -> String

List all GUC settings SQL
Source§

fn set_jwt_context_sql( &self, user_id: &str, tenant_id: Option<&str>, role: Option<&str>, ) -> String

Set JWT context SQL
Source§

fn clear_jwt_context_sql(&self) -> String

Clear JWT context SQL

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> ErasedDestructor for T
where T: 'static,

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

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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