pub struct PostgreSQLSqlGenerator;Expand description
PostgreSQL SQL generator implementation
Implementations§
Source§impl PostgreSQLSqlGenerator
impl PostgreSQLSqlGenerator
Sourcepub fn create_policy_sql(&self, policy: &Policy) -> String
pub fn create_policy_sql(&self, policy: &Policy) -> String
Create RLS policy SQL
Sourcepub fn enable_rls_sql(&self, table_name: &str, schema: Option<&str>) -> String
pub fn enable_rls_sql(&self, table_name: &str, schema: Option<&str>) -> String
Create RLS enable SQL for a table
Sourcepub fn disable_rls_sql(&self, table_name: &str, schema: Option<&str>) -> String
pub fn disable_rls_sql(&self, table_name: &str, schema: Option<&str>) -> String
Create RLS disable SQL for a table
Sourcepub fn drop_policy_sql(&self, policy: &Policy) -> String
pub fn drop_policy_sql(&self, policy: &Policy) -> String
Drop policy SQL
Sourcepub fn create_extension_sql(&self, extension: &Extension) -> String
pub fn create_extension_sql(&self, extension: &Extension) -> String
Create extension SQL
Sourcepub fn drop_extension_sql(&self, extension: &Extension) -> String
pub fn drop_extension_sql(&self, extension: &Extension) -> String
Drop extension SQL
Sourcepub fn extension_exists_sql(&self, extension_name: &str) -> String
pub fn extension_exists_sql(&self, extension_name: &str) -> String
Check if extension exists SQL
Sourcepub fn list_extensions_sql(&self) -> String
pub fn list_extensions_sql(&self) -> String
List installed extensions SQL
Sourcepub fn create_guc_sql(&self, guc: &GucSetting) -> String
pub fn create_guc_sql(&self, guc: &GucSetting) -> String
Create GUC setting SQL
Sourcepub fn reset_guc_sql(&self, guc: &GucSetting) -> String
pub fn reset_guc_sql(&self, guc: &GucSetting) -> String
Reset GUC setting SQL
Sourcepub fn get_guc_sql(&self, guc: &GucSetting) -> String
pub fn get_guc_sql(&self, guc: &GucSetting) -> String
Get GUC setting value SQL
Sourcepub fn list_guc_settings_sql(&self) -> String
pub fn list_guc_settings_sql(&self) -> String
List all GUC settings SQL
Sourcepub fn set_jwt_context_sql(
&self,
user_id: &str,
tenant_id: Option<&str>,
role: Option<&str>,
) -> String
pub fn set_jwt_context_sql( &self, user_id: &str, tenant_id: Option<&str>, role: Option<&str>, ) -> String
Set JWT context SQL
Sourcepub fn clear_jwt_context_sql(&self) -> String
pub fn clear_jwt_context_sql(&self) -> String
Clear JWT context SQL
Trait Implementations§
Source§impl SqlGenerator for PostgreSQLSqlGenerator
impl SqlGenerator for PostgreSQLSqlGenerator
Source§fn create_table_sql(&self, table: &Table) -> String
fn create_table_sql(&self, table: &Table) -> String
Generate CREATE TABLE SQL
Source§fn create_view_sql(&self, view: &View) -> String
fn create_view_sql(&self, view: &View) -> String
Generate CREATE VIEW SQL
Source§fn create_index_sql(&self, index: &Index) -> String
fn create_index_sql(&self, index: &Index) -> String
Generate CREATE INDEX SQL
Source§fn create_type_sql(&self, composite_type: &CompositeType) -> String
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
fn create_schema_sql(&self, schema_name: &str) -> String
Generate CREATE SCHEMA SQL
Source§fn alter_table_sql(&self, table: &Table, changes: &[String]) -> String
fn alter_table_sql(&self, table: &Table, changes: &[String]) -> String
Generate ALTER TABLE SQL
Source§fn drop_table_sql(&self, table_name: &str) -> String
fn drop_table_sql(&self, table_name: &str) -> String
Generate DROP TABLE SQL
Source§fn drop_view_sql(&self, view_name: &str) -> String
fn drop_view_sql(&self, view_name: &str) -> String
Generate DROP VIEW SQL
Source§fn drop_index_sql(&self, index_name: &str) -> String
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
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
fn update_sql( &self, table_name: &str, set_clause: &str, where_clause: &str, ) -> String
Generate UPDATE SQL
Source§fn select_sql(
&self,
table_name: &str,
columns: &[String],
where_clause: Option<&str>,
) -> String
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
fn quote_identifier(&self, identifier: &str) -> String
Quote an identifier (table name, column name, etc.)
Source§fn quote_string(&self, value: &str) -> String
fn quote_string(&self, value: &str) -> String
Quote a string literal
Source§fn current_timestamp_function(&self) -> &str
fn current_timestamp_function(&self) -> &str
Get the current timestamp function
Source§fn auto_increment_keyword(&self) -> &str
fn auto_increment_keyword(&self) -> &str
Get the auto-increment keyword
Source§fn create_guc_sql(&self, guc: &GucSetting) -> String
fn create_guc_sql(&self, guc: &GucSetting) -> String
Create GUC setting SQL
Source§fn reset_guc_sql(&self, guc: &GucSetting) -> String
fn reset_guc_sql(&self, guc: &GucSetting) -> String
Reset GUC setting SQL
Source§fn get_guc_sql(&self, guc: &GucSetting) -> String
fn get_guc_sql(&self, guc: &GucSetting) -> String
Get GUC setting value SQL
Source§fn list_guc_settings_sql(&self) -> String
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
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
fn clear_jwt_context_sql(&self) -> String
Clear JWT context SQL
Auto Trait Implementations§
impl Freeze for PostgreSQLSqlGenerator
impl RefUnwindSafe for PostgreSQLSqlGenerator
impl Send for PostgreSQLSqlGenerator
impl Sync for PostgreSQLSqlGenerator
impl Unpin for PostgreSQLSqlGenerator
impl UnsafeUnpin for PostgreSQLSqlGenerator
impl UnwindSafe for PostgreSQLSqlGenerator
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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