pub struct ConnectionProfile {
pub name: String,
pub role: String,
pub search_path: Vec<String>,
pub session_vars: Vec<(String, String)>,
pub read_only: bool,
pub statement_timeout: Option<u32>,
pub lock_timeout: Option<u32>,
}Expand description
A named connection profile with specific permissions.
Fields§
§name: StringProfile name.
role: StringDatabase role to use.
search_path: Vec<String>Schema search path.
session_vars: Vec<(String, String)>Session variables to set.
read_only: boolWhether this is read-only.
statement_timeout: Option<u32>Statement timeout (ms).
lock_timeout: Option<u32>Lock timeout (ms).
Implementations§
Source§impl ConnectionProfile
impl ConnectionProfile
Sourcepub fn new(
name: impl Into<String>,
role: impl Into<String>,
) -> ConnectionProfileBuilder
pub fn new( name: impl Into<String>, role: impl Into<String>, ) -> ConnectionProfileBuilder
Create a new connection profile.
Sourcepub fn to_postgres_setup(&self) -> Vec<String>
pub fn to_postgres_setup(&self) -> Vec<String>
Generate PostgreSQL session setup SQL.
Sourcepub fn to_mysql_setup(&self) -> Vec<String>
pub fn to_mysql_setup(&self) -> Vec<String>
Generate MySQL session setup SQL.
Trait Implementations§
Source§impl Clone for ConnectionProfile
impl Clone for ConnectionProfile
Source§fn clone(&self) -> ConnectionProfile
fn clone(&self) -> ConnectionProfile
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConnectionProfile
impl Debug for ConnectionProfile
Source§impl<'de> Deserialize<'de> for ConnectionProfile
impl<'de> Deserialize<'de> for ConnectionProfile
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ConnectionProfile
impl PartialEq for ConnectionProfile
Source§impl Serialize for ConnectionProfile
impl Serialize for ConnectionProfile
impl Eq for ConnectionProfile
impl StructuralPartialEq for ConnectionProfile
Auto Trait Implementations§
impl Freeze for ConnectionProfile
impl RefUnwindSafe for ConnectionProfile
impl Send for ConnectionProfile
impl Sync for ConnectionProfile
impl Unpin for ConnectionProfile
impl UnwindSafe for ConnectionProfile
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