Skip to main content

AlterUser

Struct AlterUser 

Source
pub struct AlterUser {
Show 19 fields pub if_exists: bool, pub name: Ident, pub rename_to: Option<Ident>, pub reset_password: bool, pub abort_all_queries: bool, pub add_role_delegation: Option<AlterUserAddRoleDelegation>, pub remove_role_delegation: Option<AlterUserRemoveRoleDelegation>, pub enroll_mfa: bool, pub set_default_mfa_method: Option<MfaMethodKind>, pub remove_mfa_method: Option<MfaMethodKind>, pub modify_mfa_method: Option<AlterUserModifyMfaMethod>, pub add_mfa_method_otp: Option<AlterUserAddMfaMethodOtp>, pub set_policy: Option<AlterUserSetPolicy>, pub unset_policy: Option<UserPolicyKind>, pub set_tag: KeyValueOptions, pub unset_tag: Vec<String>, pub set_props: KeyValueOptions, pub unset_props: Vec<String>, pub password: Option<AlterUserPassword>,
}
Expand description

Modifies the properties of a user

Snowflake Syntax:

ALTER USER [ IF EXISTS ] [ <name> ] [ OPTIONS ]

PostgreSQL Syntax:

ALTER USER <role_specification> [ WITH ] option [ ... ]

Fields§

§if_exists: bool

Whether to only alter the user if it exists.

§name: Ident

The name of the user to alter.

§rename_to: Option<Ident>

Optional new name for the user (Snowflake-specific). See: https://docs.snowflake.com/en/sql-reference/sql/alter-user#syntax

§reset_password: bool

Reset the user’s password.

§abort_all_queries: bool

Abort all running queries for the user.

§add_role_delegation: Option<AlterUserAddRoleDelegation>

Optionally add a delegated role authorization.

§remove_role_delegation: Option<AlterUserRemoveRoleDelegation>

Optionally remove a delegated role authorization.

§enroll_mfa: bool

Enroll the user in MFA.

§set_default_mfa_method: Option<MfaMethodKind>

Set the default MFA method for the user.

§remove_mfa_method: Option<MfaMethodKind>

Remove the user’s default MFA method.

§modify_mfa_method: Option<AlterUserModifyMfaMethod>

Modify an MFA method for the user.

§add_mfa_method_otp: Option<AlterUserAddMfaMethodOtp>

Add an MFA OTP method with optional count.

§set_policy: Option<AlterUserSetPolicy>

Set a user policy.

§unset_policy: Option<UserPolicyKind>

Unset a user policy.

§set_tag: KeyValueOptions

Key/value tag options to set on the user.

§unset_tag: Vec<String>

Tags to unset on the user.

§set_props: KeyValueOptions

Key/value properties to set on the user.

§unset_props: Vec<String>

Properties to unset on the user.

§password: Option<AlterUserPassword>

The following options are PostgreSQL-specific: https://www.postgresql.org/docs/current/sql-alteruser.html

Trait Implementations§

Source§

impl Clone for AlterUser

Source§

fn clone(&self) -> AlterUser

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for AlterUser

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for AlterUser

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<AlterUser> for Statement

Source§

fn from(a: AlterUser) -> Self

Converts to this type from the input type.
Source§

impl Hash for AlterUser

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for AlterUser

Source§

fn cmp(&self, other: &AlterUser) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for AlterUser

Source§

fn eq(&self, other: &AlterUser) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for AlterUser

Source§

fn partial_cmp(&self, other: &AlterUser) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Visit for AlterUser

Source§

fn visit<V: Visitor>(&self, visitor: &mut V) -> ControlFlow<V::Break>

Visit this node with the provided Visitor. Read more
Source§

impl VisitMut for AlterUser

Source§

fn visit<V: VisitorMut>(&mut self, visitor: &mut V) -> ControlFlow<V::Break>

Mutably visit this node with the provided VisitorMut. Read more
Source§

impl Eq for AlterUser

Source§

impl StructuralPartialEq for AlterUser

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> 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.